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 boolean
doesPasswordConfirmationMatch(String password, String pwdConfirm)
Ensures that both the passwords match, excluding 'null' matches.protected boolean
hasDigit(String password)
protected boolean
hasLowercase(String password)
protected boolean
hasNoWhitespaces(String password)
protected boolean
hasSpecialChar(String password)
protected boolean
hasUppercase(String password)
protected boolean
isTooLong(String password)
protected boolean
isTooShort(String password)
protected boolean
matchesCustomRegex(String password)
PasswordValidation
validate(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:PasswordRequestValidator
Validates the password- Specified by:
validate
in 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:PasswordRequestValidator
Ensures that both the passwords match, excluding 'null' matches. In the case that both are null, this will return false;- Specified by:
doesPasswordConfirmationMatch
in 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)
-
-