Search in sources :

Example 1 with PasswordValidationAction

use of org.apache.jackrabbit.oak.spi.security.user.action.PasswordValidationAction in project jackrabbit-oak by apache.

the class PasswordExpiryHistoryTest method getSecurityConfigParameters.

@Override
protected ConfigurationParameters getSecurityConfigParameters() {
    final PasswordValidationAction pwAction = new PasswordValidationAction();
    pwAction.init(null, ConfigurationParameters.of(PasswordValidationAction.CONSTRAINT, "^.*(?=.{4,}).*"));
    final AuthorizableActionProvider actionProvider = new AuthorizableActionProvider() {

        @Nonnull
        @Override
        public List<? extends AuthorizableAction> getAuthorizableActions(@Nonnull SecurityProvider securityProvider) {
            return ImmutableList.of(pwAction);
        }
    };
    ConfigurationParameters userConfig = ConfigurationParameters.of(ImmutableMap.of(UserConstants.PARAM_AUTHORIZABLE_ACTION_PROVIDER, actionProvider, UserConstants.PARAM_PASSWORD_MAX_AGE, 10, UserConstants.PARAM_PASSWORD_HISTORY_SIZE, 10));
    return ConfigurationParameters.of(UserConfiguration.NAME, userConfig);
}
Also used : PasswordValidationAction(org.apache.jackrabbit.oak.spi.security.user.action.PasswordValidationAction) Nonnull(javax.annotation.Nonnull) SecurityProvider(org.apache.jackrabbit.oak.spi.security.SecurityProvider) AuthorizableActionProvider(org.apache.jackrabbit.oak.spi.security.user.action.AuthorizableActionProvider) ConfigurationParameters(org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)

Aggregations

Nonnull (javax.annotation.Nonnull)1 ConfigurationParameters (org.apache.jackrabbit.oak.spi.security.ConfigurationParameters)1 SecurityProvider (org.apache.jackrabbit.oak.spi.security.SecurityProvider)1 AuthorizableActionProvider (org.apache.jackrabbit.oak.spi.security.user.action.AuthorizableActionProvider)1 PasswordValidationAction (org.apache.jackrabbit.oak.spi.security.user.action.PasswordValidationAction)1