Skip to content

Commit 82bc476

Browse files
author
Nicole Schmidt
committed
add attributes apikey and secretkey even if values are null
1 parent d183dd0 commit 82bc476

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/main/java/com/cloud/user/AccountManagerImpl.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,10 +3127,9 @@ public Pair<Boolean, Map<String, String>> getKeys(GetUserKeysCmd cmd) {
31273127
}
31283128

31293129
Map<String, String> keys = new HashMap<>();
3130-
if (keyPair != null && isAccessingKeypairSuperset(keyPair, cmd)) {
3131-
keys.put("apikey", keyPair.getApiKey());
3132-
keys.put("secretkey", keyPair.getSecretKey());
3133-
}
3130+
boolean isAllowed = keyPair != null && isAccessingKeypairSuperset(keyPair, cmd);
3131+
keys.put("apikey", isAllowed ? keyPair.getApiKey() : null);
3132+
keys.put("secretkey", isAllowed ? keyPair.getSecretKey() : null);
31343133

31353134
Boolean apiKeyAccess = user.getApiKeyAccess();
31363135
if (apiKeyAccess == null) {

0 commit comments

Comments
 (0)