| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions copyright 2011-2012 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.core; |
| | |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | // Password Policy Subentry draft attributes. |
| | | private final String PWD_OC_POLICY = "pwdpolicy"; |
| | | private final String PWD_ATTR_ATTRIBUTE = "pwdattribute"; |
| | | private final String PWD_ATTR_MINAGE = "pwdminage"; |
| | | private final String PWD_ATTR_MAXAGE = "pwdmaxage"; |
| | | private final String PWD_ATTR_INHISTORY = "pwdinhistory"; |
| | | private final String PWD_ATTR_CHECKQUALITY = "pwdcheckquality"; |
| | | private final String PWD_ATTR_MINLENGTH = "pwdminlength"; |
| | | private final String PWD_ATTR_EXPIREWARNING = "pwdexpirewarning"; |
| | | private final String PWD_ATTR_GRACEAUTHNLIMIT = "pwdgraceauthnlimit"; |
| | | private final String PWD_ATTR_LOCKOUT = "pwdlockout"; |
| | | private final String PWD_ATTR_LOCKOUTDURATION = "pwdlockoutduration"; |
| | | private final String PWD_ATTR_MAXFAILURE = "pwdmaxfailure"; |
| | | private final String PWD_ATTR_MUSTCHANGE = "pwdmustchange"; |
| | | private final String PWD_ATTR_ALLOWUSERCHANGE = "pwdallowuserchange"; |
| | | private final String PWD_ATTR_SAFEMODIFY = "pwdsafemodify"; |
| | | private final String PWD_ATTR_FAILURECOUNTINTERVAL ="pwdfailurecountinterval"; |
| | | private static final String PWD_OC_POLICY = "pwdpolicy"; |
| | | private static final String PWD_ATTR_ATTRIBUTE = "pwdattribute"; |
| | | private static final String PWD_ATTR_MINAGE = "pwdminage"; |
| | | private static final String PWD_ATTR_MAXAGE = "pwdmaxage"; |
| | | private static final String PWD_ATTR_INHISTORY = "pwdinhistory"; |
| | | private static final String PWD_ATTR_CHECKQUALITY = "pwdcheckquality"; |
| | | private static final String PWD_ATTR_MINLENGTH = "pwdminlength"; |
| | | private static final String PWD_ATTR_EXPIREWARNING = "pwdexpirewarning"; |
| | | private static final String PWD_ATTR_GRACEAUTHNLIMIT = "pwdgraceauthnlimit"; |
| | | private static final String PWD_ATTR_LOCKOUT = "pwdlockout"; |
| | | private static final String PWD_ATTR_LOCKOUTDURATION = "pwdlockoutduration"; |
| | | private static final String PWD_ATTR_MAXFAILURE = "pwdmaxfailure"; |
| | | private static final String PWD_ATTR_MUSTCHANGE = "pwdmustchange"; |
| | | private static final String PWD_ATTR_ALLOWUSERCHANGE = "pwdallowuserchange"; |
| | | private static final String PWD_ATTR_SAFEMODIFY = "pwdsafemodify"; |
| | | private static final String PWD_ATTR_FAILURECOUNTINTERVAL = |
| | | "pwdfailurecountinterval"; |
| | | |
| | | // Password Policy Subentry DN. |
| | | private final DN passwordPolicySubentryDN; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isAllowExpiredPasswordChanges() |
| | | { |
| | | return getDefaultPasswordPolicy().isAllowExpiredPasswordChanges(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isAllowMultiplePasswordValues() |
| | | { |
| | | return getDefaultPasswordPolicy().isAllowMultiplePasswordValues(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isAllowPreEncodedPasswords() |
| | | { |
| | | return getDefaultPasswordPolicy().isAllowPreEncodedPasswords(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isAllowUserPasswordChanges() |
| | | { |
| | | return pAllowUserPasswordChanges != null ? pAllowUserPasswordChanges |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isExpirePasswordsWithoutWarning() |
| | | { |
| | | return getDefaultPasswordPolicy().isExpirePasswordsWithoutWarning(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isForceChangeOnAdd() |
| | | { |
| | | // Don't use pwdMustChange since the password provided when the entry was |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isForceChangeOnReset() |
| | | { |
| | | return pForceChangeOnReset != null ? pForceChangeOnReset |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public int getGraceLoginCount() |
| | | { |
| | | return pGraceLoginCount != null ? pGraceLoginCount |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getIdleLockoutInterval() |
| | | { |
| | | return getDefaultPasswordPolicy().getIdleLockoutInterval(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public AttributeType getLastLoginTimeAttribute() |
| | | { |
| | | return getDefaultPasswordPolicy().getLastLoginTimeAttribute(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getLastLoginTimeFormat() |
| | | { |
| | | return getDefaultPasswordPolicy().getLastLoginTimeFormat(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getLockoutDuration() |
| | | { |
| | | return pLockoutDuration != null ? pLockoutDuration |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public int getLockoutFailureCount() |
| | | { |
| | | return pLockoutFailureCount != null ? pLockoutFailureCount |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getLockoutFailureExpirationInterval() |
| | | { |
| | | return pLockoutFailureExpirationInterval != null ? |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getMaxPasswordAge() |
| | | { |
| | | return pMaxPasswordAge != null ? pMaxPasswordAge |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getMaxPasswordResetAge() |
| | | { |
| | | return getDefaultPasswordPolicy().getMaxPasswordResetAge(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getMinPasswordAge() |
| | | { |
| | | return pMinPasswordAge != null ? pMinPasswordAge |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public AttributeType getPasswordAttribute() |
| | | { |
| | | return pPasswordAttribute != null ? pPasswordAttribute |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isPasswordChangeRequiresCurrentPassword() |
| | | { |
| | | return pPasswordChangeRequiresCurrentPassword != null ? |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getPasswordExpirationWarningInterval() |
| | | { |
| | | return pPasswordExpirationWarningInterval != null ? |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public int getPasswordHistoryCount() |
| | | { |
| | | return pPasswordHistoryCount != null ? pPasswordHistoryCount |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getPasswordHistoryDuration() |
| | | { |
| | | return getDefaultPasswordPolicy().getPasswordHistoryDuration(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public SortedSet<String> getPreviousLastLoginTimeFormats() |
| | | { |
| | | return getDefaultPasswordPolicy().getPreviousLastLoginTimeFormats(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getRequireChangeByTime() |
| | | { |
| | | return getDefaultPasswordPolicy().getRequireChangeByTime(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isRequireSecureAuthentication() |
| | | { |
| | | return getDefaultPasswordPolicy().isRequireSecureAuthentication(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isRequireSecurePasswordChanges() |
| | | { |
| | | return getDefaultPasswordPolicy().isRequireSecurePasswordChanges(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isSkipValidationForAdministrators() |
| | | { |
| | | return getDefaultPasswordPolicy().isSkipValidationForAdministrators(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public StateUpdateFailurePolicy getStateUpdateFailurePolicy() |
| | | { |
| | | return getDefaultPasswordPolicy().getStateUpdateFailurePolicy(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isAuthPasswordSyntax() |
| | | { |
| | | return pAuthPasswordSyntax != null ? pAuthPasswordSyntax |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public List<PasswordStorageScheme<?>> getDefaultPasswordStorageSchemes() |
| | | { |
| | | return getDefaultPasswordPolicy().getDefaultPasswordStorageSchemes(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Set<String> getDeprecatedPasswordStorageSchemes() |
| | | { |
| | | return getDefaultPasswordPolicy().getDeprecatedPasswordStorageSchemes(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public DN getDN() |
| | | { |
| | | return passwordPolicySubentryDN; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isDefaultPasswordStorageScheme(String name) |
| | | { |
| | | return getDefaultPasswordPolicy().isDefaultPasswordStorageScheme(name); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isDeprecatedPasswordStorageScheme(String name) |
| | | { |
| | | return getDefaultPasswordPolicy().isDeprecatedPasswordStorageScheme(name); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<PasswordValidator<?>> getPasswordValidators() |
| | | { |
| | | return getDefaultPasswordPolicy().getPasswordValidators(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<AccountStatusNotificationHandler<?>> |
| | | getAccountStatusNotificationHandlers() |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public PasswordGenerator<?> getPasswordGenerator() |
| | | { |
| | | return getDefaultPasswordPolicy().getPasswordGenerator(); |