class

Authly::InMemoryStateStore

Inherits Authly::StateStore < Reference < Object

Constants

MAX_ENTRIES = 10000

Live nonces kept at most; past it the oldest are dropped, so a signed-in user requesting consent pages in a loop cannot grow the hash without bound (a dropped nonce just means that form must be reloaded).

SWEEP_EVERY = 64

Every this many writes, once at least SWEEP_THRESHOLD entries exist, expired entries are removed. The sweep is at most MAX_ENTRIES long, and small stores are never swept.

SWEEP_THRESHOLD = 256

Constructors

new(default_ttl : Time::Span = 5.minutes)
Source

Instance methods

cleanup_expired

Clean up expired states

Source
consume(state : String) : Bool

true when state was stored, has not expired and has not been consumed before

Source
size
Source
store(state : String, ttl : Time::Span = 5.minutes)
Source
valid?(state : String) : Bool

Informational only: Authly's handlers never call it (a check followed by consume is not atomic).

Source