class

LavinMQ::Auth::JWT::PublicKeys

Inherits Reference < Object

Stores public keys (JWK) with expiration time. Thread-safe storage for public keys used in JWT verification.

Constructors

Instance methods

clear
Source
decode(token : String) : JWT::Token

Decodes and verifies a JWT token using the stored public keys. Returns the decoded JWT::Token if verification succeeds. Raises JWT::VerificationError if no key can verify the token or keys are unavailable/expired.

The token must carry a kid header that matches one of the cached keys; we then verify against that single key only. Iterating over every key would let an unauthenticated caller force an RS256 verification per cached key with a forged token (GH #2077).

Source
empty?
Source
expires_at
Source
get?
Source
update(keys : Hash(String, String), ttl : Time::Span)
Source