Class DelayedLoginStore
java.lang.Object
com.atlassian.jira.security.login.DelayedLoginStore
- All Implemented Interfaces:
LoginStore
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDelayedLoginStore(com.atlassian.core.util.Clock clock, ApplicationProperties applicationProperties, com.atlassian.crowd.embedded.api.CrowdService crowdService, com.atlassian.event.api.EventPublisher eventPublisher) DelayedLoginStore(com.atlassian.core.util.Clock clock, BulkLoginStore bulkLoginStore, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptiongetLoginInfo(ApplicationUser user) LoginInfois cached locally.longThis returns the maximum failed authentications attempts that the user can perform after which they will be asked for extra elevated security informationvoidonClearCache(ClearCacheEvent event) voidThis method was presented because quick import functionality doesn't restart plugin system.voidonPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) voidonPluginFrameworkStartedEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) recordLoginAttempt(ApplicationUser user, boolean authenticated) Failed authentication is immediately delegated.voidThis can be called to reset the failed login count of a userThis will update the last login time for the user without resetting the elevated security check
-
Field Details
-
FLUSH_INTERVAL
-
DELAYED_STORE_IS_DISABLED_MSG
- See Also:
-
-
Constructor Details
-
DelayedLoginStore
public DelayedLoginStore(com.atlassian.core.util.Clock clock, ApplicationProperties applicationProperties, com.atlassian.crowd.embedded.api.CrowdService crowdService, com.atlassian.event.api.EventPublisher eventPublisher) -
DelayedLoginStore
public DelayedLoginStore(com.atlassian.core.util.Clock clock, BulkLoginStore bulkLoginStore, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
getLoginInfo
LoginInfois cached locally. Local changes invalidate entries so locally (i.e on this node) data is strictly consistent. Changes between nodes are eventually consistent and are achieved viaCacheBuilder.expireAfterWrite(Duration)- Specified by:
getLoginInfoin interfaceLoginStore- Parameters:
user- the user in play. This MUST not be null.- Returns:
- a non null
LoginInfoobject
-
recordLoginAttempt
Failed authentication is immediately delegated. First successful authentication is immediately delegated. Second (and following) successful authentications (duringFLUSH_INTERVAL) are cached.- Specified by:
recordLoginAttemptin interfaceLoginStore- Parameters:
user- the user in play. This MUST not be null.authenticated- set to true if they authenticated ok or false otherwise- Returns:
- a non null
LoginInfoobject
-
updateLastLoginTime
Description copied from interface:LoginStoreThis will update the last login time for the user without resetting the elevated security check- Specified by:
updateLastLoginTimein interfaceLoginStore- Parameters:
user- the user in play. This MUST not be null.- Returns:
- a non null
LoginInfoobject
-
getMaxAuthenticationAttemptsAllowed
public long getMaxAuthenticationAttemptsAllowed()Description copied from interface:LoginStoreThis returns the maximum failed authentications attempts that the user can perform after which they will be asked for extra elevated security information- Specified by:
getMaxAuthenticationAttemptsAllowedin interfaceLoginStore- Returns:
- the maximum authentication attempts allowed.
-
resetFailedLoginCount
Description copied from interface:LoginStoreThis can be called to reset the failed login count of a user- Specified by:
resetFailedLoginCountin interfaceLoginStore- Parameters:
user- the user to authorise. This MUST not be null.
-
onClearCache
-
onPluginFrameworkStartedEvent
@EventListener public void onPluginFrameworkStartedEvent(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event) -
onPluginFrameworkShutdownEvent
@EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) -
onImportStartedEvent
This method was presented because quick import functionality doesn't restart plugin system. Hence, past events(before the backup), can be applied causing flaky tests. When quick import is performed, dropping tables and refreshing database sequencer are not transactional. Consequently, there could be stale data in database tables if scheduled job flushed data between those two operations.- Parameters:
event- that triggers flush operation
-