mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-36: Implement password aging checks.
This commit is contained in:
@@ -45,6 +45,32 @@ public class PostgreSQLPasswordPolicy implements PasswordPolicy {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The property which specifies the minimum number of days which must
|
||||
* elapse before a user may reset their password. If set to zero, the
|
||||
* default, then this restriction does not apply.
|
||||
*/
|
||||
private static final IntegerGuacamoleProperty MIN_AGE =
|
||||
new IntegerGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "postgresql-user-password-min-age"; }
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The property which specifies the maximum number of days which may
|
||||
* elapse before a user is required to reset their password. If set to zero,
|
||||
* the default, then this restriction does not apply.
|
||||
*/
|
||||
private static final IntegerGuacamoleProperty MAX_AGE =
|
||||
new IntegerGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "postgresql-user-password-max-age"; }
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The property which specifies whether all user passwords must have at
|
||||
* least one lowercase character and one uppercase character. By default,
|
||||
@@ -119,6 +145,16 @@ public class PostgreSQLPasswordPolicy implements PasswordPolicy {
|
||||
return environment.getProperty(MIN_LENGTH, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumAge() throws GuacamoleException {
|
||||
return environment.getProperty(MIN_AGE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumAge() throws GuacamoleException {
|
||||
return environment.getProperty(MAX_AGE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMultipleCaseRequired() throws GuacamoleException {
|
||||
return environment.getProperty(REQUIRE_MULTIPLE_CASE, false);
|
||||
|
Reference in New Issue
Block a user