Package io.jmix.security.impl
Class BruteForceProtectionImpl
java.lang.Object
io.jmix.security.impl.BruteForceProtectionImpl
- All Implemented Interfaces:
BruteForceProtection
@Component("sec_BruteForceProtection")
public class BruteForceProtectionImpl
extends Object
implements BruteForceProtection
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
init()
boolean
Returns a number of login attempts left for the specified pair of login and IP-address.boolean
void
registerLoginFailed
(String username, String ipAddress) Registers unsuccessful login attempt.void
registerLoginSucceeded
(String username, String ipAddress) Registers successful login attempt.
-
Constructor Details
-
BruteForceProtectionImpl
public BruteForceProtectionImpl()
-
-
Method Details
-
init
@PostConstruct protected void init() -
isBlocked
Description copied from interface:BruteForceProtection
Returns a number of login attempts left for the specified pair of login and IP-address.- Specified by:
isBlocked
in interfaceBruteForceProtection
- Parameters:
username
- username.ipAddress
- user IP-address.- Returns:
- true if count of login attempts left.
-
registerLoginFailed
Description copied from interface:BruteForceProtection
Registers unsuccessful login attempt.- Specified by:
registerLoginFailed
in interfaceBruteForceProtection
-
registerLoginSucceeded
Description copied from interface:BruteForceProtection
Registers successful login attempt. Clear attempts count for user.- Specified by:
registerLoginSucceeded
in interfaceBruteForceProtection
- Parameters:
username
- username.ipAddress
- user IP-address.
-
isProtectionEnabled
public boolean isProtectionEnabled()- Specified by:
isProtectionEnabled
in interfaceBruteForceProtection
- Returns:
- true if brute-force protection is enabled in application settings.
-