Package org.passay.rule
Class SourceRule
java.lang.Object
org.passay.rule.SourceRule
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
DigestSourceRule
Rule for determining if a password matches a password from a different source. Useful for when separate systems
cannot have matching passwords. If no source password reference has been set, then passwords will meet this rule. See
PasswordData.getPasswordReferences().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError code for regex validation failures.protected final booleanWhether to report all source matches or just the first. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new source rule.SourceRule(boolean reportAll) Creates a new source rule. -
Method Summary
Modifier and TypeMethodDescriptionCreates 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 a source password.toString()validate(PasswordData passwordData) Validates the supplied password data per the requirements of this rule.
-
Field Details
-
ERROR_CODE
Error code for regex validation failures.- See Also:
-
reportAllFailures
protected final boolean reportAllFailuresWhether to report all source matches or just the first.
-
-
Constructor Details
-
SourceRule
public SourceRule()Creates a new source rule. -
SourceRule
public SourceRule(boolean reportAll) Creates a new source 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 a source 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:
source- matching source- Returns:
- map of parameter name to value
-
toString
-