AshOnetime.Resource.Protection (ash_onetime v0.4.0)

Copy Markdown View Source

The normalized, per-action keyed-effect declaration produced by an onetime protect block.

One Protection exists per protected action, carrying its strategy (:idempotency or :one_time_nonce), identity scope, key source, fingerprint, response contract, retention, replay window, external-effect module, store-failure policy, and limits. The struct is the return type of AshOnetime.Resource.Info.protection/2 and protections/1; read its fields directly for introspection.

Summary

Types

t()

@type t() :: %AshOnetime.Resource.Protection{
  __spark_metadata__: Spark.Dsl.Entity.spark_meta(),
  action: atom(),
  commit: :with_action | :independent,
  external_effect: module() | nil,
  fingerprint: Keyword.t() | nil,
  key: [AshOnetime.KeySource.source()],
  limits: Keyword.t(),
  on_definite_store_failure: :fail_closed | :execute_untracked,
  response: AshOnetime.Resource.Response.t() | nil,
  retention: non_neg_integer() | nil,
  scope: [AshOnetime.Scope.component()],
  strategy: :idempotency | :one_time_nonce,
  window: Keyword.t() | nil
}