Copilot commented on code in PR #13955:
URL: https://github.com/apache/cloudstack/pull/13955#discussion_r4524160579
##########
api/src/main/java/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java:
##########
@@ -75,8 +77,8 @@ public class CreateAccountCmd extends BaseCmd {
@Parameter(name = ApiConstants.PASSWORD,
type = CommandType.STRING,
- required = true,
- 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.")
+ 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."
+ + " If omitted, a random password is generated, e.g.
for an account that will only ever authenticate externally via SAML/LDAP.")
Review Comment:
The PR description template is largely unfilled (types of change, severity,
and testing sections). Since your repo notes automation depends on the PR
description, please update the PR description to clearly state the functional
behavior change (password optional + auto-generation), expected impact, and how
it was tested.
##########
ui/public/locales/en.json:
##########
@@ -4077,6 +4077,7 @@
"message.restart.vpc": "Please confirm that you want to restart the VPC.",
"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.running.custom.action": "Running action",
+"message.saml.account.no.password": "This account will authenticate via SAML
SSO, so no password is needed — one will be generated automatically.",
Review Comment:
A new i18n key is added only in `en.json`. If the UI ships with additional
locales, users on those locales may see the raw key or a missing-translation
placeholder. Add this key to the other locale files (or ensure your i18n
fallback strategy won’t surface missing keys to end users).
##########
ui/src/views/iam/AddAccount.vue:
##########
@@ -250,6 +256,14 @@ export default {
}
},
immediate: false
+ },
+ 'form.samlenable' (samlEnabled) {
+ // a SAML-authenticated account never logs in with a native password
+ this.rules.password = samlEnabled ? [] : [{ required: true, message:
this.$t('message.error.required.input') }]
+ this.rules.confirmpassword = samlEnabled ? [] : [
+ { required: true, message: this.$t('message.error.required.input') },
+ { validator: this.validateConfirmPassword }
+ ]
Review Comment:
This watcher won’t run on initial render, so if `form.samlenable` is
initialized to `true` (e.g., prefilled form state), the password rules may
remain in their default (required) state even though password fields are
hidden. Convert this watcher to object syntax with `immediate: true`, or ensure
the same logic runs once during component initialization.
--
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]