Class NumericalPasswordRule
- java.lang.Object
-
- org.apache.archiva.redback.policy.rules.AbstractPasswordRule
-
- org.apache.archiva.redback.policy.rules.NumericalPasswordRule
-
- All Implemented Interfaces:
PasswordRule
@Service("passwordRule#numerical-count") public class NumericalPasswordRule extends AbstractPasswordRule
Basic Password Rule, Checks for non-empty passwords that have at leastsetMinimumCount(int)
of numerical characters contained within.- Author:
- Joakim Erdfelt
-
-
Field Summary
-
Fields inherited from class org.apache.archiva.redback.policy.rules.AbstractPasswordRule
config, enabled
-
-
Constructor Summary
Constructors Constructor Description NumericalPasswordRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMinimumCount()
void
initialize()
to use in case of configuration change.void
setMinimumCount(int minimumCount)
void
setUserSecurityPolicy(UserSecurityPolicy policy)
Sets the User Security Policy to use.void
testPassword(PasswordRuleViolations violations, User user)
Tests theUser.getPassword()
for a valid password, based on rule.-
Methods inherited from class org.apache.archiva.redback.policy.rules.AbstractPasswordRule
isEnabled, requiresSecurityPolicy
-
-
-
-
Constructor Detail
-
NumericalPasswordRule
public NumericalPasswordRule()
-
-
Method Detail
-
getMinimumCount
public int getMinimumCount()
-
setMinimumCount
public void setMinimumCount(int minimumCount)
-
setUserSecurityPolicy
public void setUserSecurityPolicy(UserSecurityPolicy policy)
Description copied from interface:PasswordRule
Sets the User Security Policy to use. The policy is set once per instance of a PasswordRule object.- Parameters:
policy
- the policy to use.
-
testPassword
public void testPassword(PasswordRuleViolations violations, User user)
Description copied from interface:PasswordRule
Tests theUser.getPassword()
for a valid password, based on rule.- Parameters:
violations
- the place to add any password rule violations that this rule has discovered.user
- the User to test.
-
initialize
@PostConstruct public void initialize()
Description copied from interface:PasswordRule
to use in case of configuration change.
-
-