Provides common audit logging behaviour for Ash actions.
Summary
Functions
Record a status override for the audit log entry that will be written for this action.
Tag a query/changeset/action input with a unique reference used to bridge
status overrides from downstream after_action callbacks into the audit
log's after_transaction callback.
Types
@type input() :: Ash.ActionInput.t() | Ash.Changeset.t() | Ash.Query.t()
@type result() :: {:ok, Ash.Resource.record()} | {:ok, [Ash.Resource.record()]} | {:error, any()}
Functions
@spec record_status_override(input(), :success | :failure | :unknown) :: :ok
Record a status override for the audit log entry that will be written for this action.
Called from a preparation's after_action (or change's after_action) when
the result of the action alone is not sufficient to determine whether the
operation should be recorded as :success or :failure (for example,
password reset and magic-link request actions return :ok regardless of
whether the submitted identity resolved to a known user).
If the audit-log add-on is not configured for this action, this call is a no-op.
Tag a query/changeset/action input with a unique reference used to bridge
status overrides from downstream after_action callbacks into the audit
log's after_transaction callback.
Called automatically by the audit-log Preparation and Change modules;
you should not need to call this directly.