# `AshVault.Macaroon.Actions.Mint`
[🔗](https://github.com/jakeschurch/ash_vault/blob/main/lib/ash_vault/macaroon/actions/mint.ex#L1)

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
