weizhouapache commented on code in PR #8370:
URL: https://github.com/apache/cloudstack/pull/8370#discussion_r1433750622


##########
server/src/main/java/com/cloud/user/PasswordPolicy.java:
##########
@@ -79,8 +79,8 @@ public interface PasswordPolicy {
             "Advanced",
             String.class,
             "password.policy.regex",
-            ".+",
-            "A regular expression that the user's password must match. The 
default expression '.+' will match with any password.",
+            "",
+            "A regular expression that the user's password must match. By 
default no expression is used.",

Review Comment:
   @DaanHoogland 
   password is a required field when create a user, it is not empty when create 
user via API or UI.
   but it is empty when import a ldap user. we need to support both scenarios.
   
   @JoaoJandre 
   can we just skip the check if password is empty ?
   ```
        public void verifyIfPasswordCompliesWithPasswordPolicies(String 
password, String username, Long domainId) {
   +        if (StringUtils.isEmpty(password)) {
   +            return; // password is empty when import LDAP user
   +        }
            int numberOfSpecialCharactersInPassword = 0;
            int numberOfUppercaseLettersInPassword = 0;
            int numberOfLowercaseLettersInPassword = 0;
   ```



-- 
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]

Reply via email to