AshVault.Macaroon.Actions.Mint (AshVault v0.2.0)

Copy Markdown View Source

Backs the generated :mint_<name> generic action.

Loads the record named by the identity argument through the resource's primary read action (same actor, tenant and authorize? as the mint), refuses a missing or revoked record, then signs. Arguments:

  • the identity attribute (identity in the DSL) — which record the token names
  • :caveats — a map of declared caveat names to values, cast to each caveat's type
  • :ttl — seconds, overriding default_ttl; refused above max_ttl

A function default_ttl is called with this action's input, and its answer clamped to max_ttl.

Returns the token string. The token is a bearer credential: it is returned once and never stored by AshVault.