KMS.Principals.FactorProvider behaviour (kms v0.1.0)

Copy Markdown View Source

Issues authentication factor challenges.

Providers return a one-time secret that KMS uses as the next PDK and a public challenge map returned to callers. Providers may deliver the secret out of band and omit it from the challenge.

Summary

Callbacks

issue(t, t, keyword)

@callback issue(KMS.Principals.PrincipalFactor.t(), KMS.Sessions.Session.t(), keyword()) ::
  {:ok, %{:secret => binary(), optional(:challenge) => map()}}
  | {:error, term()}

verify(t, t, map, keyword)

(optional)
@callback verify(
  KMS.Principals.PrincipalFactor.t(),
  KMS.Sessions.Session.t(),
  map(),
  keyword()
) ::
  {:ok, binary()} | {:error, term()}