Package io.goobi.viewer.controller
Class SecurityManager
java.lang.Object
io.goobi.viewer.controller.SecurityManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFailedLoginAttemptForIpAddress
(String ipAddress) Adds to the failed attempts counter for the given IP address.void
addFailedLoginAttemptForUserName
(String userName) Adds to the failed attempts counter for the given user name.long
getDelayForIpAddress
(String ipAddress) long
getDelayForUserName
(String userName) boolean
isRequireCaptcha
(String ipAddress) void
reset()
Resets all maps.void
resetFailedLoginAttemptForIpAddress
(String ipAddress) Removes failed login attempt history for given IP address.void
resetFailedLoginAttemptForUserName
(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
-