# `AshAuthentication.Strategy.KubernetesServiceAccount.Api`
[🔗](https://git.jakeschurch.com/jake/ash_authentication_kubernetes/src/tag/v0.1.0/lib/ash_authentication/strategy/kubernetes_service_account/api.ex#L1)

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

  * `:api` — base URL, default `https://kubernetes.default.svc`;
  * `:token_file` — this application's own (projected) service-account
    token, sent as the Bearer; reread on each request so kubelet rotation
    applies. Required for TokenReview; optional for JWKS;
  * `:ca_file` — CA bundle for the API server (e.g. `kube-root-ca.crt`);
  * `:issuer` — `:oidc_jwks`: the expected `iss`, default
    `https://kubernetes.default.svc.cluster.local`;
  * `:jwks_uri` — `:oidc_jwks`: default `<api>/openid/v1/jwks`;
  * `:jwks_ttl` — `:oidc_jwks`: milliseconds keys are cached, default 300000;
  * `:jwks_refetch_ms` — `:oidc_jwks`: minimum milliseconds between
    refetches for an unknown `kid`, default 30000;
  * `:req_options` — extra `Req` options (tests: `plug:`).

# `api_server?`

```elixir
@spec api_server?(keyword(), String.t()) :: boolean()
```

Whether `url` is on the API server itself (same scheme, host and port as
`api`): only then is this application's own token sent with a request, so a
`jwks_uri` pointing at another issuer never receives it.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
