AshOnetime.Scope behaviour (ash_onetime v0.6.0)

Copy Markdown View Source

Closed, explicit scope algebra for collision isolation.

The context map passed to the resolve/2 callback is the BOUNDED callback context: %{resource:, action:} — the trusted local facts the admission path derives itself (AGENTS.md: "verification callbacks return trusted local facts"). Caller-supplied context (actor, tenant, etc.) is NOT forwarded; see AshOnetime.Verifier for the same contract.

Summary

Types

component()

@type component() ::
  {:tenant, module()}
  | {:argument, atom()}
  | {:attribute, atom()}
  | {:static, binary()}

Callbacks

resolve(arg1, map)

@callback resolve(Ash.Changeset.t() | Ash.ActionInput.t(), map()) ::
  {:ok, AshOnetime.Canonical.value()} | {:error, term()}

Functions

normalize(components)

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

references(components)

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