AshAuthentication.Strategy.KubernetesServiceAccount.TokenVerifier behaviour (AshAuthentication.Kubernetes v0.1.0)

Copy Markdown View Source

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

{:error, :unauthenticated} refuses the token; {:error, %UnavailableError{}} reports that no verdict could be reached. options are the strategy's resolved api options merged with the verifier's own. Results are cached by AshAuthentication.Strategy.KubernetesServiceAccount.VerdictCache, not by the verifier.

Summary

Callbacks

verify(token, audiences, options)

@callback verify(token :: String.t(), audiences :: [String.t()], options :: keyword()) ::
  {:ok,
   AshAuthentication.Strategy.KubernetesServiceAccount.IdentityMapper.identity()}
  | {:error,
     :unauthenticated
     | AshAuthentication.Strategy.KubernetesServiceAccount.UnavailableError.t()}