AshVault.Macaroon.Caveats.ActionIn (AshVault v0.2.0)

Copy Markdown View Source

An :authorize-phase caveat check: admits the request only if the action being authorized is named in the caveat's list.

caveat :actions, {:array, :string},
  phase: :authorize,
  check: AshVault.Macaroon.Caveats.ActionIn

With qualified?: true the names are "Resource.action" (inspect(resource) <> "." <> action), for tokens that must be limited across resources.

In the :verify phase there is no action yet, so it refuses: declare it phase: :authorize.