Skip to content

Commit 8936e4c

Browse files
api:rename RegisterCmd.java => RegisterUserKeyCmd.java (#12259)
1 parent e9900ab commit 8936e4c

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

api/src/main/java/com/cloud/user/AccountService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
2626
import org.apache.cloudstack.api.command.admin.account.CreateAccountCmd;
2727
import org.apache.cloudstack.api.command.admin.user.GetUserKeysCmd;
28-
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
28+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
2929
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
3030

3131
import com.cloud.dc.DataCenter;
@@ -95,7 +95,7 @@ User createUser(String userName, String password, String firstName, String lastN
9595

9696
void markUserRegistered(long userId);
9797

98-
public String[] createApiKeyAndSecretKey(RegisterCmd cmd);
98+
public String[] createApiKeyAndSecretKey(RegisterUserKeyCmd cmd);
9999

100100
public String[] createApiKeyAndSecretKey(final long userId);
101101

api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
import org.apache.cloudstack.api.ApiConstants;
2727
import org.apache.cloudstack.api.BaseCmd;
2828
import org.apache.cloudstack.api.Parameter;
29-
import org.apache.cloudstack.api.response.RegisterResponse;
29+
import org.apache.cloudstack.api.response.RegisterUserKeyResponse;
3030
import org.apache.cloudstack.api.response.UserResponse;
3131

3232
import java.util.Map;
3333

3434
@APICommand(name = "getUserKeys",
3535
description = "This command allows the user to query the seceret and API keys for the account",
36-
responseObject = RegisterResponse.class,
36+
responseObject = RegisterUserKeyResponse.class,
3737
requestHasSensitiveInfo = false,
3838
responseHasSensitiveInfo = true,
3939
authorized = {RoleType.User, RoleType.Admin, RoleType.DomainAdmin, RoleType.ResourceAdmin},
@@ -57,7 +57,7 @@ public Long getID(){
5757
public void execute(){
5858
Pair<Boolean, Map<String, String>> keys = _accountService.getKeys(this);
5959

60-
RegisterResponse response = new RegisterResponse();
60+
RegisterUserKeyResponse response = new RegisterUserKeyResponse();
6161
if(keys != null){
6262
response.setApiKeyAccess(keys.first());
6363
response.setApiKey(keys.second().get("apikey"));

api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java renamed to api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterUserKeyCmd.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
import org.apache.cloudstack.api.ApiConstants;
2323
import org.apache.cloudstack.api.BaseCmd;
2424
import org.apache.cloudstack.api.Parameter;
25-
import org.apache.cloudstack.api.response.RegisterResponse;
25+
import org.apache.cloudstack.api.response.RegisterUserKeyResponse;
2626
import org.apache.cloudstack.api.response.UserResponse;
2727

2828
import com.cloud.user.Account;
2929
import com.cloud.user.User;
3030

3131
@APICommand(name = "registerUserKeys",
32-
responseObject = RegisterResponse.class,
32+
responseObject = RegisterUserKeyResponse.class,
3333
description = "This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user",
3434
requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
35-
public class RegisterCmd extends BaseCmd {
35+
public class RegisterUserKeyCmd extends BaseCmd {
3636

3737

3838
/////////////////////////////////////////////////////
@@ -81,7 +81,7 @@ public ApiCommandResourceType getApiResourceType() {
8181
@Override
8282
public void execute() {
8383
String[] keys = _accountService.createApiKeyAndSecretKey(this);
84-
RegisterResponse response = new RegisterResponse();
84+
RegisterUserKeyResponse response = new RegisterUserKeyResponse();
8585
if (keys != null) {
8686
response.setApiKey(keys[0]);
8787
response.setSecretKey(keys[1]);

api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java renamed to api/src/main/java/org/apache/cloudstack/api/response/RegisterUserKeyResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import com.cloud.serializer.Param;
2525

26-
public class RegisterResponse extends BaseResponse {
26+
public class RegisterUserKeyResponse extends BaseResponse {
2727
@SerializedName(ApiConstants.API_KEY)
2828
@Param(description = "the api key of the registered user", isSensitive = true)
2929
private String apiKey;

plugins/network-elements/juniper-contrail/src/test/java/org/apache/cloudstack/network/contrail/management/MockAccountManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
3838
import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd;
3939
import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;
40-
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
40+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
4141
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
4242
import org.apache.cloudstack.context.CallContext;
4343

@@ -118,7 +118,7 @@ public void checkAccess(Account arg0, AccessType arg1, boolean arg2, ControlledE
118118
}
119119

120120
@Override
121-
public String[] createApiKeyAndSecretKey(RegisterCmd arg0) {
121+
public String[] createApiKeyAndSecretKey(RegisterUserKeyCmd arg0) {
122122
// TODO Auto-generated method stub
123123
return null;
124124
}

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
import org.apache.cloudstack.api.command.admin.user.ListUsersCmd;
283283
import org.apache.cloudstack.api.command.admin.user.LockUserCmd;
284284
import org.apache.cloudstack.api.command.admin.user.MoveUserCmd;
285-
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
285+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
286286
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
287287
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
288288
import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
@@ -3931,7 +3931,7 @@ public List<Class<?>> getCommands() {
39313931
cmdList.add(ListUsersCmd.class);
39323932
cmdList.add(LockUserCmd.class);
39333933
cmdList.add(MoveUserCmd.class);
3934-
cmdList.add(RegisterCmd.class);
3934+
cmdList.add(RegisterUserKeyCmd.class);
39353935
cmdList.add(UpdateUserCmd.class);
39363936
cmdList.add(CreateVlanIpRangeCmd.class);
39373937
cmdList.add(UpdateVlanIpRangeCmd.class);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;
6262
import org.apache.cloudstack.api.command.admin.user.GetUserKeysCmd;
6363
import org.apache.cloudstack.api.command.admin.user.MoveUserCmd;
64-
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
64+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
6565
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
6666
import org.apache.cloudstack.api.response.UserTwoFactorAuthenticationSetupResponse;
6767
import org.apache.cloudstack.auth.UserAuthenticator;
@@ -3129,7 +3129,7 @@ public UserTwoFactorAuthenticator getUserTwoFactorAuthenticationProvider(final S
31293129
@Override
31303130
@DB
31313131
@ActionEvent(eventType = EventTypes.EVENT_REGISTER_FOR_SECRET_API_KEY, eventDescription = "register for the developer API keys")
3132-
public String[] createApiKeyAndSecretKey(RegisterCmd cmd) {
3132+
public String[] createApiKeyAndSecretKey(RegisterUserKeyCmd cmd) {
31333133
Account caller = getCurrentCallingAccount();
31343134
final Long userId = cmd.getId();
31353135

0 commit comments

Comments
 (0)