AshAuthentication. Strategy. KubernetesServiceAccount. VerdictCache
(AshAuthentication.Kubernetes v0.1.0)
Copy Markdown
View Source
Per-node cache of verification verdicts (and JWKS key sets), owned by this library's application. Keys are SHA-256 of the token, never the token.
Summary
Functions
Returns a specification to start this module under a supervisor.
Drops everything cached (tests, and after changing verifiers).
Verifies token for strategy, from the cache while a verdict lives.
In the last 5000ms of a verdict one caller re-verifies (single
flight); an outage then keeps the cached verdict until it expires, a refusal
drops it.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec flush() :: :ok
Drops everything cached (tests, and after changing verifiers).
@spec verify(AshAuthentication.Strategy.KubernetesServiceAccount.t(), String.t()) :: {:ok, map()} | {:error, :unauthenticated | AshAuthentication.Strategy.KubernetesServiceAccount.UnavailableError.t()}
Verifies token for strategy, from the cache while a verdict lives.
In the last 5000ms of a verdict one caller re-verifies (single
flight); an outage then keeps the cached verdict until it expires, a refusal
drops it.