weizhouapache commented on code in PR #11637:
URL: https://github.com/apache/cloudstack/pull/11637#discussion_r2348738815
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -1499,6 +1502,14 @@ protected String[] createUserApiKeyAndSecretKey(long
userId) {
}
}
+ protected String generateRandomUserPassword(Long domainId) {
+ Integer passwordPolicyMinimumLength =
PasswordPolicy.PasswordPolicyMinimumLength.valueIn(domainId);
+ if (passwordPolicyMinimumLength == null || passwordPolicyMinimumLength
< CKS_USER_MIN_PASSWORD_LENGTH) {
+ passwordPolicyMinimumLength = CKS_USER_MIN_PASSWORD_LENGTH;
Review Comment:
actually CKS user password policy check is ignored, that's the main change
of this PR
```
if (!User.Source.CKS.equals(source)) {
passwordPolicy.verifyIfPasswordCompliesWithPasswordPolicies(password, userName,
getAccount(accountId).getDomainId());
}
```
the password policy check has several checks (regex, username, min length,
min uppcase, min lowercase, min digits)
ideally there should be a method to generate a random password which matches
all the password requirements, it looks difficult so far.
--
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]