2121
2222import com .cloud .utils .Pair ;
2323import org .apache .cloudstack .acl .ControlledEntity ;
24+ import org .apache .cloudstack .acl .RolePermissionEntity ;
2425import org .apache .cloudstack .acl .RoleType ;
2526import org .apache .cloudstack .acl .SecurityChecker .AccessType ;
27+ import org .apache .cloudstack .acl .apikeypair .ApiKeyPair ;
28+ import org .apache .cloudstack .acl .apikeypair .ApiKeyPairPermission ;
29+ import org .apache .cloudstack .api .BaseCmd ;
2630import org .apache .cloudstack .api .command .admin .account .CreateAccountCmd ;
27- import org .apache .cloudstack .api .command .admin .user .GetUserKeysCmd ;
28- import org .apache .cloudstack .api .command .admin .user .RegisterUserKeyCmd ;
29- import org .apache .cloudstack .api .command .admin .user .UpdateUserCmd ;
3031
3132import com .cloud .dc .DataCenter ;
3233import com .cloud .domain .Domain ;
3536import com .cloud .offering .DiskOffering ;
3637import com .cloud .offering .NetworkOffering ;
3738import com .cloud .offering .ServiceOffering ;
39+ import org .apache .cloudstack .api .command .admin .user .DeleteUserKeysCmd ;
40+ import org .apache .cloudstack .api .command .admin .user .GetUserKeysCmd ;
41+ import org .apache .cloudstack .api .command .admin .user .ListUserKeyRulesCmd ;
42+ import org .apache .cloudstack .api .command .admin .user .ListUserKeysCmd ;
43+ import org .apache .cloudstack .api .command .admin .user .RegisterUserKeysCmd ;
44+ import org .apache .cloudstack .api .command .admin .user .UpdateUserCmd ;
45+ import org .apache .cloudstack .api .response .ApiKeyPairResponse ;
46+ import org .apache .cloudstack .api .response .ListResponse ;
3847import org .apache .cloudstack .auth .UserTwoFactorAuthenticator ;
3948import org .apache .cloudstack .backup .BackupOffering ;
4049
@@ -97,7 +106,7 @@ User createUser(String userName, String password, String firstName, String lastN
97106
98107 void markUserRegistered (long userId );
99108
100- public String [] createApiKeyAndSecretKey (RegisterUserKeyCmd cmd );
109+ ApiKeyPair createApiKeyAndSecretKey (RegisterUserKeysCmd cmd );
101110
102111 public String [] createApiKeyAndSecretKey (final long userId );
103112
@@ -125,6 +134,8 @@ User createUser(String userName, String password, String firstName, String lastN
125134
126135 void validateAccountHasAccessToResource (Account account , AccessType accessType , Object resource );
127136
137+ void validateCallingUserHasAccessToDesiredUser (Long userId );
138+
128139 Long finalizeAccountId (String accountName , Long domainId , Long projectId , boolean enabledOnly );
129140
130141 /**
@@ -134,9 +145,15 @@ User createUser(String userName, String password, String firstName, String lastN
134145 */
135146 UserAccount getUserAccountById (Long userId );
136147
137- public Pair <Boolean , Map <String , String >> getKeys (GetUserKeysCmd cmd );
148+ Pair <Boolean , Map <String , String >> getKeys (GetUserKeysCmd cmd );
149+
150+ ListResponse <ApiKeyPairResponse > listKeys (ListUserKeysCmd cmd );
138151
139- public Pair <Boolean , Map <String , String >> getKeys (Long userId );
152+ List <ApiKeyPairPermission > listKeyRules (ListUserKeyRulesCmd cmd );
153+
154+ void deleteApiKey (DeleteUserKeysCmd cmd );
155+
156+ void deleteApiKey (ApiKeyPair id );
140157
141158 /**
142159 * Lists user two-factor authentication provider plugins
@@ -151,4 +168,13 @@ User createUser(String userName, String password, String firstName, String lastN
151168 */
152169 UserTwoFactorAuthenticator getUserTwoFactorAuthenticationProvider (final Long domainId );
153170
171+ ApiKeyPair getLatestUserKeyPair (Long userId );
172+
173+ ApiKeyPair getKeyPairById (Long id );
174+
175+ ApiKeyPair getKeyPairByApiKey (String apiKey );
176+
177+ String getAccessingApiKey (BaseCmd cmd );
178+
179+ List <RolePermissionEntity > getAllKeypairPermissions (String apiKey );
154180}
0 commit comments