weizhouapache commented on code in PR #13828:
URL: https://github.com/apache/cloudstack/pull/13828#discussion_r3830938269


##########
server/src/main/java/com/cloud/api/ApiServer.java:
##########
@@ -1156,7 +1156,7 @@ public boolean verifyRequest(final Map<String, Object[]> 
requestParameters, fina
             CallContext.register(user, account);
 
             List<ApiKeyPairPermission> keyPairPermissions = 
keyPairManager.findAllPermissionsByKeyPairId(keyPair.getId(), 
account.getRoleId());
-            if (commandAvailable(remoteAddress, commandName, user, 
keyPairPermissions.toArray(new ApiKeyPairPermission[0]))) {
+            if (commandAvailable(remoteAddress, commandName, user, keyPair, 
keyPairPermissions.toArray(new ApiKeyPairPermission[0]))) {
                 logger.info("API accessed through API Key Pair. API Key: 
[{}].", keyPair.getApiKey());

Review Comment:
   btw, it looks like this additional check will increase the latency of 
request.
   have you tested it ? 
   
   cc @bernardodemarco @winterhazel 



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