Class DefaultPasswordRequestValidator
- java.lang.Object
-
- com.broadleafcommerce.auth.user.validation.DefaultPasswordRequestValidator
-
- All Implemented Interfaces:
PasswordRequestValidator
@ConfigurationProperties("broadleaf.auth.password.validator") public class DefaultPasswordRequestValidator extends Object implements PasswordRequestValidator- Author:
- Nathan Moore (nathanmoore), Phillip Verheyden (phillipuniverse)
-
-
Constructor Summary
Constructors Constructor Description DefaultPasswordRequestValidator(PasswordValidatorProperties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoesPasswordConfirmationMatch(String password, String pwdConfirm)Ensures that both the passwords match, excluding 'null' matches.protected booleanhasDigit(String password)protected booleanhasLowercase(String password)protected booleanhasNoWhitespaces(String password)protected booleanhasSpecialChar(String password)protected booleanhasUppercase(String password)protected booleanisTooLong(String password)protected booleanisTooShort(String password)protected booleanmatchesCustomRegex(String password)PasswordValidationvalidate(String password)Validates the password
-
-
-
Constructor Detail
-
DefaultPasswordRequestValidator
public DefaultPasswordRequestValidator(PasswordValidatorProperties props)
-
-
Method Detail
-
validate
@NonNull public PasswordValidation validate(@Nullable String password)
Description copied from interface:PasswordRequestValidatorValidates the password- Specified by:
validatein interfacePasswordRequestValidator- Returns:
- the validation result after running through all of the validations
-
doesPasswordConfirmationMatch
public boolean doesPasswordConfirmationMatch(@Nullable String password, @Nullable String pwdConfirm)Description copied from interface:PasswordRequestValidatorEnsures that both the passwords match, excluding 'null' matches. In the case that both are null, this will return false;- Specified by:
doesPasswordConfirmationMatchin interfacePasswordRequestValidator- Parameters:
password- what the user typed in as the passwordpwdConfirm- confirmation dialogue that the user gave- Returns:
- true if the passwords match, false otherwise
-
isTooShort
protected boolean isTooShort(@Nullable String password)
-
isTooLong
protected boolean isTooLong(@Nullable String password)
-
hasUppercase
protected boolean hasUppercase(@Nullable String password)
-
hasLowercase
protected boolean hasLowercase(@Nullable String password)
-
hasNoWhitespaces
protected boolean hasNoWhitespaces(@Nullable String password)
-
hasSpecialChar
protected boolean hasSpecialChar(@Nullable String password)
-
hasDigit
protected boolean hasDigit(@Nullable String password)
-
matchesCustomRegex
protected boolean matchesCustomRegex(@Nullable String password)
-
-