AshVault.Macaroon.CheckContext (AshVault v0.2.0)

Copy Markdown View Source

What a caveat check is handed alongside the caveat's value.

  • :phase — :verify (inside the verifying read, after the record is loaded) or :authorize (inside AshVault.Checks.MacaroonAllows)
  • :now — the verifier's clock (AshVault.Macaroon.Clock), never caller-supplied
  • :resource, :macaroon, :scope, :tenant, :actor
  • :record — the record the token names (:verify), or the actor (:authorize)
  • :action — the action being authorized (:authorize only)
  • :subject — the query, changeset or action input being authorized (:authorize only)
  • :context — the Ash context of the verifying read or authorized action. It is request-supplied: a check may use it as the request a caveat restricts (an IP, a path), never as a source of trust.

Summary

Types

t()

@type t() :: %AshVault.Macaroon.CheckContext{
  action: term(),
  actor: term(),
  context: term(),
  macaroon: term(),
  now: term(),
  phase: term(),
  record: term(),
  resource: term(),
  scope: term(),
  subject: term(),
  tenant: term()
}