API Reference AshAuthentication.Kubernetes v#0.1.0

Copy Markdown View Source

Modules

Sign an in-cluster workload in by its projected Kubernetes service-account token.

HTTP access to the API server (TokenReview, JWKS) from the strategy's api options

Maps a verified service-account identity to the actor's attributes.

The strategy's sign-in read (manual; no data layer involved): verifies the token, maps the identity and answers the actor. A refused token or identity is no record; an outage is UnavailableError.

Verifies a service-account token and answers the identity it carries.

Verifies locally against the service-account issuer's JWKS (<api>/openid/v1/jwks by default, or jwks_uri): asymmetric signature by a published key, iss equal to issuer, an accepted audience, exp in the future and nbf (when present) reached, and a sub that agrees with the kubernetes.io claims. Keys are cached for jwks_ttl and refetched (at most every jwks_refetch_ms, default 30 seconds) when a token names an unknown kid, so issuer key rotation needs nothing.

Verifies with the API server's TokenReview (authentication.k8s.io/v1), authenticated by this application's own token (token_file), which needs system:auth-delegator. The API server checks signature, expiry, audience and that the bound object (Pod) still exists.

The token could not be verified — API server or JWKS unreachable, or this application's own token or RBAC refused. An outage, never a verdict on the caller's token: answer 503, not 401.

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.