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.client;
017
018
019
020import org.forgerock.opendj.config.ManagedObjectDefinition;
021import org.forgerock.opendj.config.PropertyException;
022import org.forgerock.opendj.server.config.server.DictionaryPasswordValidatorCfg;
023
024
025
026/**
027 * A client-side interface for reading and modifying Dictionary
028 * Password Validator settings.
029 * <p>
030 * The Dictionary Password Validator determines whether a proposed
031 * password is acceptable based on whether the given password value
032 * appears in a provided dictionary file.
033 */
034public interface DictionaryPasswordValidatorCfgClient extends PasswordValidatorCfgClient {
035
036  /**
037   * Get the configuration definition associated with this Dictionary Password Validator.
038   *
039   * @return Returns the configuration definition associated with this Dictionary Password Validator.
040   */
041  ManagedObjectDefinition<? extends DictionaryPasswordValidatorCfgClient, ? extends DictionaryPasswordValidatorCfg> definition();
042
043
044
045  /**
046   * Gets the "case-sensitive-validation" property.
047   * <p>
048   * Indicates whether this password validator is to treat password
049   * characters in a case-sensitive manner.
050   * <p>
051   * If it is set to true, then the validator rejects a password only
052   * if it appears in the dictionary with exactly the same
053   * capitalization as provided by the user.
054   *
055   * @return Returns the value of the "case-sensitive-validation" property.
056   */
057  boolean isCaseSensitiveValidation();
058
059
060
061  /**
062   * Sets the "case-sensitive-validation" property.
063   * <p>
064   * Indicates whether this password validator is to treat password
065   * characters in a case-sensitive manner.
066   * <p>
067   * If it is set to true, then the validator rejects a password only
068   * if it appears in the dictionary with exactly the same
069   * capitalization as provided by the user.
070   *
071   * @param value The value of the "case-sensitive-validation" property.
072   * @throws PropertyException
073   *           If the new value is invalid.
074   */
075  void setCaseSensitiveValidation(boolean value) throws PropertyException;
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   * Sets the "check-substrings" property.
096   * <p>
097   * Indicates whether this password validator is to match portions of
098   * the password string against dictionary words.
099   * <p>
100   * If "false" then only match the entire password against words
101   * otherwise ("true") check whether the password contains words.
102   *
103   * @param value The value of the "check-substrings" property.
104   * @throws PropertyException
105   *           If the new value is invalid.
106   */
107  void setCheckSubstrings(Boolean value) throws PropertyException;
108
109
110
111  /**
112   * Gets the "dictionary-file" property.
113   * <p>
114   * Specifies the path to the file containing a list of words that
115   * cannot be used as passwords.
116   * <p>
117   * It should be formatted with one word per line. The value can be
118   * an absolute path or a path that is relative to the OpenDJ instance
119   * root.
120   *
121   * @return Returns the value of the "dictionary-file" property.
122   */
123  String getDictionaryFile();
124
125
126
127  /**
128   * Sets the "dictionary-file" property.
129   * <p>
130   * Specifies the path to the file containing a list of words that
131   * cannot be used as passwords.
132   * <p>
133   * It should be formatted with one word per line. The value can be
134   * an absolute path or a path that is relative to the OpenDJ instance
135   * root.
136   *
137   * @param value The value of the "dictionary-file" property.
138   * @throws PropertyException
139   *           If the new value is invalid.
140   */
141  void setDictionaryFile(String value) throws PropertyException;
142
143
144
145  /**
146   * Gets the "java-class" property.
147   * <p>
148   * Specifies the fully-qualified name of the Java class that
149   * provides the password validator implementation.
150   *
151   * @return Returns the value of the "java-class" property.
152   */
153  String getJavaClass();
154
155
156
157  /**
158   * Sets the "java-class" property.
159   * <p>
160   * Specifies the fully-qualified name of the Java class that
161   * provides the password validator implementation.
162   *
163   * @param value The value of the "java-class" property.
164   * @throws PropertyException
165   *           If the new value is invalid.
166   */
167  void setJavaClass(String value) throws PropertyException;
168
169
170
171  /**
172   * Gets the "min-substring-length" property.
173   * <p>
174   * Indicates the minimal length of the substring within the password
175   * in case substring checking is enabled.
176   * <p>
177   * If "check-substrings" option is set to true, then this parameter
178   * defines the length of the smallest word which should be used for
179   * substring matching. Use with caution because values below 3 might
180   * disqualify valid passwords.
181   *
182   * @return Returns the value of the "min-substring-length" property.
183   */
184  int getMinSubstringLength();
185
186
187
188  /**
189   * Sets the "min-substring-length" property.
190   * <p>
191   * Indicates the minimal length of the substring within the password
192   * in case substring checking is enabled.
193   * <p>
194   * If "check-substrings" option is set to true, then this parameter
195   * defines the length of the smallest word which should be used for
196   * substring matching. Use with caution because values below 3 might
197   * disqualify valid passwords.
198   *
199   * @param value The value of the "min-substring-length" property.
200   * @throws PropertyException
201   *           If the new value is invalid.
202   */
203  void setMinSubstringLength(Integer value) throws PropertyException;
204
205
206
207  /**
208   * Gets the "test-reversed-password" property.
209   * <p>
210   * Indicates whether this password validator is to test the reversed
211   * value of the provided password as well as the order in which it
212   * was given.
213   * <p>
214   * For example, if the user provides a new password of "password"
215   * and this configuration attribute is set to true, then the value
216   * "drowssap" is also tested against attribute values in the user's
217   * entry.
218   *
219   * @return Returns the value of the "test-reversed-password" property.
220   */
221  boolean isTestReversedPassword();
222
223
224
225  /**
226   * Sets the "test-reversed-password" property.
227   * <p>
228   * Indicates whether this password validator is to test the reversed
229   * value of the provided password as well as the order in which it
230   * was given.
231   * <p>
232   * For example, if the user provides a new password of "password"
233   * and this configuration attribute is set to true, then the value
234   * "drowssap" is also tested against attribute values in the user's
235   * entry.
236   *
237   * @param value The value of the "test-reversed-password" property.
238   * @throws PropertyException
239   *           If the new value is invalid.
240   */
241  void setTestReversedPassword(boolean value) throws PropertyException;
242
243}