AshOnetime.KeySource behaviour (ash_onetime v0.1.0)

Copy Markdown View Source

Closed key-source algebra used by protected actions.

Summary

Types

source()

@type source() ::
  {:client, atom()}
  | {:argument, atom()}
  | {:attribute, atom()}
  | {:external, atom()}
  | {:verified, atom(), module()}
  | {:minted, module()}

Callbacks

algorithm()

@callback algorithm() :: :hmac_sha256 | :ed25519

mint(context)

@callback mint(context :: map()) :: {:ok, AshOnetime.Verified.t()} | {:error, term()}

trust_model()

@callback trust_model() :: :same_service | :separated

Functions

normalize(value)

@spec normalize(source() | [source()]) :: {:ok, [source()]} | {:error, String.t()}

references(sources)

@spec references([source()]) :: %{arguments: [atom()], attributes: [atom()]}