Validate empty regex password policy with white-space characters (#22807)

Closes #20411

Signed-off-by: Pedro Hos <pedro-hos@outlook.com>
This commit is contained in:
Pedro Hos 2024-05-15 08:56:02 -03:00 committed by GitHub
parent 6b6f3fcf05
commit 2180d50b18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,6 +57,8 @@ public class RegexPatternsPasswordPolicyProvider implements PasswordPolicyProvid
public Object parseConfig(String value) { public Object parseConfig(String value) {
if (value == null) { if (value == null) {
throw new PasswordPolicyConfigException("Config required"); throw new PasswordPolicyConfigException("Config required");
} else if(value.trim().isEmpty()) {
throw new PasswordPolicyConfigException("White space not acepted");
} }
try { try {
return Pattern.compile(value); return Pattern.compile(value);