Interface LoginAttemptDecision
- All Known Implementing Classes:
LoginAttemptDecision.Allowed, LoginAttemptDecision.LockedOut
public sealed interface LoginAttemptDecision
permits LoginAttemptDecision.Allowed, LoginAttemptDecision.LockedOut
Outcome of
LoginAttemptPolicy.beforeAttempt(LoginAttemptContext).
Sealed so callers can switch exhaustively without a default
case — a future variant for, say, "rate-limited per IP only" forces
a compile error at every existing call site.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe attempt may proceed.static final recordThe caller is locked out. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic LoginAttemptDecision.Allowedallowed()Convenience for the singletonLoginAttemptDecision.Allowed.Convenience forLoginAttemptDecision.LockedOut.
-
Method Details
-
allowed
Convenience for the singletonLoginAttemptDecision.Allowed. -
lockedOut
Convenience forLoginAttemptDecision.LockedOut.- Parameters:
remaining- time until the lockout window expiresfailedAttempts- number of failed attempts that caused the lockout- Returns:
- a
LoginAttemptDecision.LockedOutdecision carrying both values
-