001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.server.config.server;
017
018
019
020import org.forgerock.opendj.config.server.ConfigurationChangeListener;
021
022
023
024/**
025 * A server-side interface for querying Dictionary Password Validator
026 * settings.
027 * <p>
028 * The Dictionary Password Validator determines whether a proposed
029 * password is acceptable based on whether the given password value
030 * appears in a provided dictionary file.
031 */
032public interface DictionaryPasswordValidatorCfg extends PasswordValidatorCfg {
033
034  /**
035   * Gets the configuration class associated with this Dictionary Password Validator.
036   *
037   * @return Returns the configuration class associated with this Dictionary Password Validator.
038   */
039  Class<? extends DictionaryPasswordValidatorCfg> configurationClass();
040
041
042
043  /**
044   * Register to be notified when this Dictionary Password Validator is changed.
045   *
046   * @param listener
047   *          The Dictionary Password Validator configuration change listener.
048   */
049  void addDictionaryChangeListener(ConfigurationChangeListener<DictionaryPasswordValidatorCfg> listener);
050
051
052
053  /**
054   * Deregister an existing Dictionary Password Validator configuration change listener.
055   *
056   * @param listener
057   *          The Dictionary Password Validator configuration change listener.
058   */
059  void removeDictionaryChangeListener(ConfigurationChangeListener<DictionaryPasswordValidatorCfg> listener);
060
061
062
063  /**
064   * Gets the "case-sensitive-validation" property.
065   * <p>
066   * Indicates whether this password validator is to treat password
067   * characters in a case-sensitive manner.
068   * <p>
069   * If it is set to true, then the validator rejects a password only
070   * if it appears in the dictionary with exactly the same
071   * capitalization as provided by the user.
072   *
073   * @return Returns the value of the "case-sensitive-validation" property.
074   */
075  boolean isCaseSensitiveValidation();
076
077
078
079  /**
080   * Gets the "check-substrings" property.
081   * <p>
082   * Indicates whether this password validator is to match portions of
083   * the password string against dictionary words.
084   * <p>
085   * If "false" then only match the entire password against words
086   * otherwise ("true") check whether the password contains words.
087   *
088   * @return Returns the value of the "check-substrings" property.
089   */
090  boolean isCheckSubstrings();
091
092
093
094  /**
095   * Gets the "dictionary-file" property.
096   * <p>
097   * Specifies the path to the file containing a list of words that
098   * cannot be used as passwords.
099   * <p>
100   * It should be formatted with one word per line. The value can be
101   * an absolute path or a path that is relative to the OpenDJ instance
102   * root.
103   *
104   * @return Returns the value of the "dictionary-file" property.
105   */
106  String getDictionaryFile();
107
108
109
110  /**
111   * Gets the "java-class" property.
112   * <p>
113   * Specifies the fully-qualified name of the Java class that
114   * provides the password validator implementation.
115   *
116   * @return Returns the value of the "java-class" property.
117   */
118  String getJavaClass();
119
120
121
122  /**
123   * Gets the "min-substring-length" property.
124   * <p>
125   * Indicates the minimal length of the substring within the password
126   * in case substring checking is enabled.
127   * <p>
128   * If "check-substrings" option is set to true, then this parameter
129   * defines the length of the smallest word which should be used for
130   * substring matching. Use with caution because values below 3 might
131   * disqualify valid passwords.
132   *
133   * @return Returns the value of the "min-substring-length" property.
134   */
135  int getMinSubstringLength();
136
137
138
139  /**
140   * Gets the "test-reversed-password" property.
141   * <p>
142   * Indicates whether this password validator is to test the reversed
143   * value of the provided password as well as the order in which it
144   * was given.
145   * <p>
146   * For example, if the user provides a new password of "password"
147   * and this configuration attribute is set to true, then the value
148   * "drowssap" is also tested against attribute values in the user's
149   * entry.
150   *
151   * @return Returns the value of the "test-reversed-password" property.
152   */
153  boolean isTestReversedPassword();
154
155}