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 (
:sourceby default) is a required atom. Each locally declared scope attribute is required.:provideris a required atom constrained to the allowlist's aliases. :secret_refand:previous_secret_refare nullable opaque reference strings.:secret_kindand:previous_secret_kindare nullable terms.:public_keyand:public_key_kindare nullable terms for pinned sender verification material outside custody. Its kind must be one ofAshHooks.Custody.PublicKey's closed asymmetric kinds, and the material must decode under that kind before creation or registration.:pausedis a required boolean defaulting to false.:secret_created_at,:secret_first_used_at,:previous_secret_created_at,:previous_secret_first_used_atand:previous_secret_retired_atare 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
| Name | Type | Default | Docs |
|---|---|---|---|
ledger required | module | The InboundDelivery resource this source feeds. | |
providers required | keyword | Provider alias to module allowlist. Rows store aliases. | |
custodian required | module | The AshHooks.Custody implementation. Sources have no byte resolver path. | |
key_registry required | module | KeyRegistry resource with the same transactional data layer and repository for writes, and matching attribute tenancy. | |
source_attribute | atom | :source | Attribute holding the inbound declaration name. |
scope | list({atom, any, keyword}) | [] | Locally declared {name, type, constraints} scope attributes, matching the ledger's scope_identity. |
custody_tenant_key | mfa | Canonical custody tenant hook for a tenant type without built-in canonicalization. | |
max_overlap_seconds | pos_integer | Maximum permitted overlap in seconds, at least the effective default. | |
default_overlap_seconds | non_neg_integer | Default overlap in seconds. Defaults to 86,400; zero is a hard cut. |