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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

flush()

@spec flush() :: :ok

Drops everything cached (tests, and after changing verifiers).

verify(strategy, token)

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.