Package io.goobi.viewer.controller
Class SecurityManager
java.lang.Object
io.goobi.viewer.controller.SecurityManager
Manages login security by tracking failed login attempts per user name and IP address.
Enforces configurable delays and CAPTCHA requirements after repeated failed attempts to
protect against brute-force attacks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailedLoginAttemptForIpAddress(String ipAddress) Adds to the failed attempts counter for the given IP address.voidaddFailedLoginAttemptForUserName(String userName) Adds to the failed attempts counter for the given user name.longgetDelayForIpAddress(String ipAddress) longgetDelayForUserName(String userName) booleanisRequireCaptcha(String ipAddress) voidreset()Resets all maps.voidresetFailedLoginAttemptForIpAddress(String ipAddress) Removes failed login attempt history for given IP address.voidresetFailedLoginAttemptForUserName(String userName) Removes failed login attempt history for given user name.
-
Constructor Details
-
SecurityManager
public SecurityManager()
-
-
Method Details
-
reset
public void reset()Resets all maps. Used for unit tests. -
isRequireCaptcha
- Parameters:
ipAddress- IP address to check- Returns:
- true if captcha is appropriate; false otherwise
-
getDelayForUserName
- Parameters:
userName- User name / e-mail address to check- Returns:
- Current login delay for the given userName
-
getDelayForIpAddress
- Parameters:
ipAddress- IP address to check- Returns:
- Current login delay for the given ipAddress
-
addFailedLoginAttemptForUserName
Adds to the failed attempts counter for the given user name.- Parameters:
userName- User name / e-mail address
-
addFailedLoginAttemptForIpAddress
Adds to the failed attempts counter for the given IP address.- Parameters:
ipAddress- IP address
-
resetFailedLoginAttemptForUserName
Removes failed login attempt history for given user name.- Parameters:
userName- User name / e-mail address
-
resetFailedLoginAttemptForIpAddress
Removes failed login attempt history for given IP address.- Parameters:
ipAddress- IP address
-