<!--
This file was generated by Spark. Do not edit it by hand.
-->
# AshHooks.InboundSource

<a id="AshHooks-InboundSource"></a>

A host-owned resource for inbound webhook keys, provider selection and pause.

Sources use opaque keys through `AshHooks.Custody`. The host owns the data
layer, policies and migrations. Source and ledger resources must have the
same tenancy and non-nullable scope attributes. Provider aliases select
modules from a compile-time allowlist. Each ledger declaration's `source_record`
must name a source whose `ledger` is that declaring resource.

The extension injects the following attributes for host migrations:

* The declaration-name attribute (`:source` by default) is a required atom.
  Each locally declared scope attribute is required. `:provider` is a required
  atom constrained to the allowlist's aliases.
* `:secret_ref` and `:previous_secret_ref` are nullable opaque reference
  strings. `:secret_kind` and `:previous_secret_kind` are nullable terms.
* `:public_key` and `:public_key_kind` are nullable terms for pinned sender
  verification material outside custody. Its kind must be one of
  `AshHooks.Custody.PublicKey`'s closed asymmetric kinds, and the material
  must decode under that kind before creation or registration. `:paused` is a required boolean
  defaulting to false.
* `:secret_created_at`, `:secret_first_used_at`,
  `:previous_secret_created_at`, `:previous_secret_first_used_at` and
  `:previous_secret_retired_at` are nullable microsecond UTC datetimes.

Without a host primary key, the extension adds a writable UUID `:id` with a
generated default. The `:unique_source` identity comprises the declaration-name
attribute and scope attributes, under the resource's tenancy. Host attributes
with injected names must match their type, constraints and nullability.

Lifecycle functions are system writes using `authorize?: false`. Authorize
callers before invoking them and restrict direct access to injected machine
actions. Generated disclosures are returned once and must be delivered to
the sender securely. They are never stored on the source.

Injected machine actions are `:roll_secret`, `:schedule_previous_retirement`,
`:expire_previous_secret`, `:register_public_key`, `:pause`, `:unpause`,
`:mark_current_secret_used`, `:mark_previous_secret_used`, `:set_custody_keys`
and `:read_custody_owner`. Secret-bearing arguments are sensitive. Direct
kind input is refused on host create and update actions. Direct reference
input is always refused; use `create_source/3` to issue and attach
references through the key registry.


## inbound_source
An inbound source with custody keys and a durable provider allowlist.






### Options

<table><thead><tr><th style="text-align: left;">Name</th><th style="text-align: left;">Type</th><th style="text-align: left;">Default</th><th style="text-align: left;">Docs</th></tr></thead><tbody><tr><td style="text-align: left;"><a class="spark-required" href="#inbound_source-ledger" id="inbound_source-ledger"><code class="inline">ledger</code></a> <strong>required</strong></td><td style="text-align: left;"><code class="inline">module</code></td><td style="text-align: left;"></td><td style="text-align: left;">The InboundDelivery resource this source feeds.</td></tr><tr><td style="text-align: left;"><a class="spark-required" href="#inbound_source-providers" id="inbound_source-providers"><code class="inline">providers</code></a> <strong>required</strong></td><td style="text-align: left;"><code class="inline">keyword</code></td><td style="text-align: left;"></td><td style="text-align: left;">Provider alias to module allowlist. Rows store aliases.</td></tr><tr><td style="text-align: left;"><a class="spark-required" href="#inbound_source-custodian" id="inbound_source-custodian"><code class="inline">custodian</code></a> <strong>required</strong></td><td style="text-align: left;"><code class="inline">module</code></td><td style="text-align: left;"></td><td style="text-align: left;">The AshHooks.Custody implementation. Sources have no byte resolver path.</td></tr><tr><td style="text-align: left;"><a class="spark-required" href="#inbound_source-key_registry" id="inbound_source-key_registry"><code class="inline">key_registry</code></a> <strong>required</strong></td><td style="text-align: left;"><code class="inline">module</code></td><td style="text-align: left;"></td><td style="text-align: left;">KeyRegistry resource with the same transactional data layer and repository for writes, and matching attribute tenancy.</td></tr><tr><td style="text-align: left;"><a href="#inbound_source-source_attribute" id="inbound_source-source_attribute"><code class="inline">source_attribute</code></a></td><td style="text-align: left;"><code class="inline">atom</code></td><td style="text-align: left;"><code class="inline">:source</code></td><td style="text-align: left;">Attribute holding the inbound declaration name.</td></tr><tr><td style="text-align: left;"><a href="#inbound_source-scope" id="inbound_source-scope"><code class="inline">scope</code></a></td><td style="text-align: left;"><code class="inline">list({atom, any, keyword})</code></td><td style="text-align: left;"><code class="inline">[]</code></td><td style="text-align: left;">Locally declared {name, type, constraints} scope attributes, matching the ledger's scope_identity.</td></tr><tr><td style="text-align: left;"><a href="#inbound_source-custody_tenant_key" id="inbound_source-custody_tenant_key"><code class="inline">custody_tenant_key</code></a></td><td style="text-align: left;"><code class="inline">mfa</code></td><td style="text-align: left;"></td><td style="text-align: left;">Canonical custody tenant hook for a tenant type without built-in canonicalization.</td></tr><tr><td style="text-align: left;"><a href="#inbound_source-max_overlap_seconds" id="inbound_source-max_overlap_seconds"><code class="inline">max_overlap_seconds</code></a></td><td style="text-align: left;"><code class="inline">pos_integer</code></td><td style="text-align: left;"></td><td style="text-align: left;">Maximum permitted overlap in seconds, at least the effective default.</td></tr><tr><td style="text-align: left;"><a href="#inbound_source-default_overlap_seconds" id="inbound_source-default_overlap_seconds"><code class="inline">default_overlap_seconds</code></a></td><td style="text-align: left;"><code class="inline">non_neg_integer</code></td><td style="text-align: left;"></td><td style="text-align: left;">Default overlap in seconds. Defaults to 86,400; zero is a hard cut.</td></tr></tbody></table>







<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>
