# AshAuthentication.Kubernetes v0.1.0 - API Reference

## Modules

- [AshAuthentication.Strategy.KubernetesServiceAccount](AshAuthentication.Strategy.KubernetesServiceAccount.md): Sign an in-cluster workload in by its projected Kubernetes service-account
token.
- [AshAuthentication.Strategy.KubernetesServiceAccount.Api](AshAuthentication.Strategy.KubernetesServiceAccount.Api.md): HTTP access to the API server (TokenReview, JWKS) from the strategy's `api`
options
- [AshAuthentication.Strategy.KubernetesServiceAccount.IdentityMapper](AshAuthentication.Strategy.KubernetesServiceAccount.IdentityMapper.md): Maps a verified service-account identity to the actor's attributes.
- [AshAuthentication.Strategy.KubernetesServiceAccount.SignIn](AshAuthentication.Strategy.KubernetesServiceAccount.SignIn.md): 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`.

- [AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier](AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier.md): Verifies a service-account token and answers the identity it carries.
- [AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier.Jwks](AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier.Jwks.md): 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.
- [AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier.TokenReview](AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier.TokenReview.md): 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.

- [AshAuthentication.Strategy.KubernetesServiceAccount.VerdictCache](AshAuthentication.Strategy.KubernetesServiceAccount.VerdictCache.md): 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.

- Exceptions
  - [AshAuthentication.Strategy.KubernetesServiceAccount.UnavailableError](AshAuthentication.Strategy.KubernetesServiceAccount.UnavailableError.md): 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.

