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

Copy Markdown View Source

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

Answer {:ok, attributes} (applied with struct/2 to the resource) or :error to refuse the identity (an authentication failure). Called on every sign-in; keep it cheap.

Summary

Types

identity()

@type identity() :: %{
  namespace: String.t(),
  name: String.t(),
  username: String.t(),
  uid: String.t() | nil,
  audiences: [String.t()],
  expires_at: DateTime.t(),
  extra: map()
}

Callbacks

map_identity(identity, t)

@callback map_identity(
  identity(),
  AshAuthentication.Strategy.KubernetesServiceAccount.t()
) ::
  {:ok, map()} | :error