You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/04/07 15:14:40 UTC

[GitHub] [cloudstack] soreana opened a new pull request #4023: FIX: prevent empty sshkey name.

soreana opened a new pull request #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023
 
 
   ## Description
   It is a small bug fix preventing ssh key name to be empty.
   
   
   Items | FIX CloudStack API allows SSHKeyPair name to be empty
   -- | --
   Steps | create a sshkeypair with empty name `cloudmonkey create sshkeypair name=`
   Expected Results | operation should fail
   Actual results | sshkey pair is created successfully
   
   
   ## Types of changes
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## How Has This Been Tested?
   Created a small Cloudstack environment with three hypervisor and one management server. Try to create sshKey with empty name via cloudmonkey.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610890164
 
 
   @blueorangutan package

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] soreana commented on a change in pull request #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
soreana commented on a change in pull request #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#discussion_r405444406
 
 

 ##########
 File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
 ##########
 @@ -3711,6 +3711,11 @@ public SSHKeyPair createSSHKeyPair(final CreateSSHKeyPairCmd cmd) {
         final SSHKeysHelper keys = new SSHKeysHelper(sshKeyLength.value());
 
         final String name = cmd.getName();
+        
+        if (StringUtils.isBlank(name)) {
+            throw new InvalidParameterValueException("Please specify a valid name for the key pair. The key name can't be empty");
+        }
+        
 
 Review comment:
   Thanks for your comment. Moved it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610838851
 
 
   If we have time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-613393725
 
 
   I'm okay to merge it only on 4.14/master, ideally this can go back many older major versions @DaanHoogland @andrijapanicsb 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-611462906
 
 
   @blueorangutan test

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610937151
 
 
   @DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610804402
 
 
   @andrijapanicsb @rhtyd @weizhouapache @PaulAngus would we want this n 4.13.1 as well?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610936871
 
 
   @blueorangutan package

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610890505
 
 
   @rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#discussion_r405319313
 
 

 ##########
 File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
 ##########
 @@ -3711,6 +3711,11 @@ public SSHKeyPair createSSHKeyPair(final CreateSSHKeyPairCmd cmd) {
         final SSHKeysHelper keys = new SSHKeysHelper(sshKeyLength.value());
 
         final String name = cmd.getName();
+        
+        if (StringUtils.isBlank(name)) {
+            throw new InvalidParameterValueException("Please specify a valid name for the key pair. The key name can't be empty");
+        }
+        
 
 Review comment:
   can you move this validation above the validation that queries the DB above?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610962530
 
 
   Packaging result: ✔centos7 ✔debian. JID-1152

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] rhtyd commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610890047
 
 
   @andrijapanicsb @DaanHoogland this is sent to master, changing base to 4.13 introduced many commits/issues - I'm okay to take this in against 4.14 milestone (master).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-611898192
 
 
   ok @rhtyd (cc @andrijapanicsb )
   @soreana if you want this in an earlier branch please rebase your commit, otherwise leave as is.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb merged pull request #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
andrijapanicsb merged pull request #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-610893331
 
 
   Packaging result: ✖centos7 ✖debian. JID-1149

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-611463240
 
 
   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-611764323
 
 
   <b>Trillian test result (tid-1398)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 36838 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4023-t1398-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 83 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [cloudstack] andrijapanicsb commented on issue #4023: FIX: prevent empty sshkey name.

Posted by GitBox <gi...@apache.org>.
andrijapanicsb commented on issue #4023: FIX: prevent empty sshkey name.
URL: https://github.com/apache/cloudstack/pull/4023#issuecomment-613470351
 
 
   Merging based on 2 x LGTMs/Approvals, manual and regression tests passing.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services