Class StoreBackedLoginAttemptPolicy

java.lang.Object
com.svenruppert.jsentinel.bruteforce.StoreBackedLoginAttemptPolicy
All Implemented Interfaces:
LoginAttemptPolicy

@ExperimentalJSentinelApi public final class StoreBackedLoginAttemptPolicy extends Object implements LoginAttemptPolicy
LoginAttemptPolicy that stores its failure counters in a LoginAttemptStore.

Counter and last-failure timestamp survive a process restart — a lockout earned on Monday is still in effect on Tuesday. Unlike the InMemoryLoginAttemptPolicy default, this implementation runs a flat lockout: once LoginAttemptConfiguration.failureThreshold() failures accumulate within the configured LoginAttemptConfiguration.window(), the key locks for LoginAttemptConfiguration.initialLockout() starting at the last failure. The progressive backoff that the in-memory policy offers requires per-key history (lockout level, "just locked" flag) that the narrower LoginAttemptStore contract does not carry — applications that need progressive backoff stay on the in-memory policy or wrap this one with a richer key store.

Bound to one TenantId at construction. Multi-tenant deployments instantiate one policy per tenant or wrap with a resolver.