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