Package org.passay
Class SourceRule
- java.lang.Object
-
- org.passay.SourceRule
-
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
DigestSourceRule
public class SourceRule extends Object implements Rule
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. SeePasswordData.setPasswordReferences(List)
- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for regex validation failures.protected boolean
reportAllFailures
Whether to report all source matches or just the first.
-
Constructor Summary
Constructors Constructor Description SourceRule()
Creates a new source rule.SourceRule(boolean reportAll)
Creates a new source rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters(String source)
Creates the parameter data for the rule result detail.protected boolean
matches(String password, PasswordData.Reference reference)
Determines whether a password matches a source password.RuleResult
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for regex validation failures.- See Also:
- Constant Field Values
-
reportAllFailures
protected boolean reportAllFailures
Whether to report all source matches or just the first.
-
-
Method Detail
-
validate
public RuleResult validate(PasswordData passwordData)
Description copied from interface:Rule
Validates the supplied password data per the requirements of this rule.
-
matches
protected boolean matches(String password, PasswordData.Reference reference)
Determines whether a password matches a source password.- Parameters:
password
- candidate passwordreference
- reference password- Returns:
- true if passwords match, false otherwise.
-
-