bernardodemarco commented on code in PR #13149:
URL: https://github.com/apache/cloudstack/pull/13149#discussion_r3320456147


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -3320,6 +3320,10 @@ private Boolean isAccessingKeypairSuperset(ApiKeyPair 
accessedKeyPair, BaseCmd c
             return Boolean.TRUE;
         }
         ApiKeyPair accessingKeyPair = apiKeyPairService.findByApiKey(apiKey);
+        if (accessingKeyPair == null) {
+            logger.warn("Unable to find API key pair for the accessing API 
key: {}", apiKey);
+            return Boolean.TRUE;

Review Comment:
   @weizhouapache @winterhazel great catch guys... you are correct, we should 
return `Boolean.FALSE` here. 
   
   When I first reviewed the PR, I had not paid too much attention and I had 
inferred that we would have to return  `Boolean.TRUE` because of the first 
conditional statement. But, as Fabricio has explained here 
https://github.com/apache/cloudstack/pull/13149/changes#r3320265882, the first 
conditional structure checks whether the API call is performed via session key.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to