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
server: skip password policies check on empty password (#8370)
This PR changes the password.policy.regex default value to empty. With an empty value for the configuration, it is skipped during the password policy check, only when the configuration is set to something different than a blank string, the regex will get checked.
This way, when creating a user on org.apache.cloudstack.ldap.LdapAuthenticator#authenticate() we won't get an error by default, as an empty value for the password is passed.
logger.trace(String.format("Regex is null; therefore, we will not validate if the new password matches with regex for user [%s].", username));
197
+
if (StringUtils.isEmpty(passwordPolicyRegex)) {
198
+
logger.trace(String.format("Regex is empty; therefore, we will not validate if the new password matches with regex for user [%s].", username));
193
199
return;
194
200
}
195
201
196
-
if (!password.matches(passwordPolicyRegex)){
202
+
if (!password.matches(passwordPolicyRegex)){
197
203
logger.error(String.format("User [%s] informed a new password that does not match with regex [%s]. Refusing the user's new password.", username, passwordPolicyRegex));
198
204
thrownewInvalidParameterValueException("User password does not match with password policy regex.");
0 commit comments