You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a17946
Browse filesBrowse the repository at this point in the historyBrowse files
authored
make password an optional parameter/field in createAccount (#13955)
* make password an optional parameter/field in createAccount
* Update api/src/main/java/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
Co-authored-by: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com>
* Apply suggestion from @vishesh92
* disallow empty passwords
* make null-password test not depend on the internal-error path
* Remove extra space
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* space after punctuation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @DaanHoogland
---------
Co-authored-by: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
//////////////// API parameters /////////////////////
@@ -75,8 +77,8 @@ public class CreateAccountCmd extends BaseCmd {
75
77
76
78
@Parameter(name = ApiConstants.PASSWORD,
77
79
type = CommandType.STRING,
78
-
required = true,
79
-
description = "Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.")
80
+
description = "Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you will need to write a custom authentication adapter. See Docs section."
81
+
+ " If omitted, a random password is generated, e.g. for an account that will only ever authenticate externally via SAML/LDAP.")
80
82
privateStringpassword;
81
83
82
84
@Parameter(name = ApiConstants.TIMEZONE,
@@ -191,10 +193,16 @@ public void execute() {
191
193
192
194
/**
193
195
* TODO: this should be done through a validator. for now replicating the validation logic in create account and user
196
+
*
197
+
* <p>An omitted password generates a random one instead of failing, since an account that will
198
+
* only ever authenticate externally (SAML/LDAP) has no need for the admin to set one. A password
199
+
* that is passed but blank is still rejected, as that is more likely a client error.
194
200
*/
195
201
privatevoidvalidateParams() {
196
-
if(StringUtils.isEmpty(getPassword())) {
197
-
thrownewServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not allowed");
Copy file name to clipboardExpand all lines: ui/public/locales/en.json
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4112,6 +4112,7 @@
4112
4112
"message.restart.vpc": "Please confirm that you want to restart the VPC.",
4113
4113
"message.restart.vpc.remark": "Please confirm that you want to restart the VPC <p><i>Remark: making a non-redundant VPC redundant will force a clean up. The Networks will not be available for a couple of minutes</i>.</p>",
"message.saml.account.no.password": "This account will authenticate via SAML SSO, so no password is needed — one will be generated automatically.",
4115
4116
"message.scale.processing": "Scale in progress",
4116
4117
"message.scaledown.policies": "Please add at least a ScaleDown policy. The AutoScale Group will be scaled down when all conditions in a ScaleDown policy are matched. ScaleDown policies will be checked after ScaleUp policies.",
4117
4118
"message.scaledown.policy.continue": "Please add at least condition to ScaleDown policy to continue",
0 commit comments