]> WPIA git - gigi.git/blob - src/club/wpia/gigi/passwords/PasswordChecker.java
add: PasswordChecker interface
[gigi.git] / src / club / wpia / gigi / passwords / PasswordChecker.java
1 package club.wpia.gigi.passwords;
2
3 import club.wpia.gigi.GigiApiException;
4 import club.wpia.gigi.dbObjects.Name;
5
6 /**
7  * A strategy to check whether a password is acceptable for use or not.
8  */
9 public interface PasswordChecker {
10
11     /**
12      * Checks if a password is acceptable for use.
13      * Most implementations judge a password’s strength in some way
14      * and reject weak passwords.
15      *
16      * @param password The password to check.
17      * @param nameParts The name parts of the user that wants to use this password.
18      * @param email The email address of the user that wants to use this password.
19      * @return {@code null} if the password is acceptable,
20      * otherwise a {@link GigiApiException} with an appropriate error message.
21      */
22     public GigiApiException checkPassword(String password, String[] nameParts, String email);
23 }