Package org.passay.rule
Class HistoryRule
java.lang.Object
org.passay.rule.HistoryRule
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
DigestHistoryRule
Rule for determining if a password matches one of any previous password a user has chosen. If no historical password
reference has been set, then passwords will meet this rule. See
PasswordData.getPasswordReferences().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError code for history violation.protected final booleanWhether to report all history matches or just the first. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new history rule.HistoryRule(boolean reportAll) Creates a new history rule. -
Method Summary
Modifier and TypeMethodDescriptioncreateRuleResultDetailParameters(int size) Creates the parameter data for the rule result detail.booleanReturns whether to report all matches or just the first.protected booleanmatches(UnicodeString password, Reference reference) Determines whether a password matches an historical password.toString()validate(PasswordData passwordData) Validates the supplied password data per the requirements of this rule.
-
Field Details
-
ERROR_CODE
Error code for history violation.- See Also:
-
reportAllFailures
protected final boolean reportAllFailuresWhether to report all history matches or just the first.
-
-
Constructor Details
-
HistoryRule
public HistoryRule()Creates a new history rule. -
HistoryRule
public HistoryRule(boolean reportAll) Creates a new history rule.- Parameters:
reportAll- whether to report all matches or just the first
-
-
Method Details
-
getReportAllFailures
public boolean getReportAllFailures()Returns whether to report all matches or just the first.- Returns:
- whether to report all matches or just the first
-
validate
Description copied from interface:RuleValidates the supplied password data per the requirements of this rule. -
matches
Determines whether a password matches an historical password.- Parameters:
password- candidate passwordreference- reference password- Returns:
- true if passwords match, false otherwise.
-
createRuleResultDetailParameters
Creates the parameter data for the rule result detail.- Parameters:
size- of the history list- Returns:
- map of parameter name to value
-
toString
-