class

KemalIdentity::Testing::MemoryRevocationStore

Inherits KemalIdentity::JWT::RevocationStore < Reference < Object

In-memory JWT::RevocationStore, passing the same contract a database-backed one must.

Constructors

Instance methods

delete_expired(before : Time) : Int32

Drops entries whose tokens have expired, returning how many. Called by Sweeper.

Source
revoke(jti : String, expires_at : Time) : Nil

Refuses this jti from now on.

expires_at is the token's own exp. Recording it is what lets the entry be swept: after that instant the token fails on expiry anyway.

Revoking twice is not an error — the caller may be replaying a "sign out everywhere" that was already applied.

Source
revoked?(jti : String) : Bool

Whether this jti has been revoked. Called on every request that carries a token, so it must be cheap; an implementation backed by a database wants an index on the id.

Source
size
Source