Lockspire.JwksFetcher
(lockspire v1.0.0)
Copy Markdown
Fetches and caches JSON Web Key Sets (JWKS) dynamically using Req and Cachex.
Summary
Types
@type result() :: {:ok, JOSE.JWK.t()} | {:error, {:jwks_fetch_failed, atom() | {atom(), atom() | integer()}}}
Functions
@spec cache_ttl() :: pos_integer()
Returns the JWKS cache TTL in milliseconds for successful fetches.
Retrieves a parsed JOSE.JWK (which contains the JWKSet) from the given URI.
Hits the network only on cache miss. Strict timeouts are enforced.
Forces a bounded cache refresh for the given JWKS URI.
This bypasses the cached entry, updates the cache only on a successful refetch, and preserves the last-known-good cached entry when the refresh fails.