Sigra → Chimeway auth notification bridge (ECOS-09).
Conditionally compiled when optional :chimeway dep is present.
Triggers identifier-only Chimeway.trigger/3 calls for magic link and
confirmation-code flows; sensitive URL/code values live in
PendingDelivery until notifier rendering/2 reads and deletes them.
Idempotency keys
- Magic link:
sigra.magic_link:{user_id}:{token_inserted_at_iso} - Confirmation code:
sigra.confirmation_code:{user_id}:{confirmation_id}whereconfirmation_idis the inserted link-token row id (opaque ref).
MFA stand-in
Confirmation-code dispatch stands in for ECOS-09 "MFA token dispatch" until Sigra ships dedicated outbound MFA OTP APIs (D-05).
Summary
Functions
Generates confirmation tokens, inserts link/code rows, and dispatches via Chimeway.
Triggers sigra.auth.magic_link after a successful magic-link request.
Calls Sigra.Auth.request_magic_link/3 then dispatches via Chimeway on success.
Functions
@spec dispatch_confirmation_after_generate(module(), struct(), keyword()) :: {:ok, {String.t(), String.t(), String.t(), map()}} | {:error, term()}
Generates confirmation tokens, inserts link/code rows, and dispatches via Chimeway.
Does not call Sigra.Delivery.deliver/3 — Chimeway Logger adapter only in Phase 64 tests.
@spec dispatch_magic_link(module(), struct(), String.t(), String.t(), keyword()) :: {:ok, map()} | {:duplicate, struct()} | {:error, term()}
Triggers sigra.auth.magic_link after a successful magic-link request.
Stores the login URL in PendingDelivery keyed by idempotency key; trigger
params contain identifiers only (no url or raw_token).
@spec dispatch_magic_link_after_request(module(), String.t(), keyword()) :: {:ok, {String.t(), String.t(), map()}} | {:ok, :sent} | {:error, term()}
Calls Sigra.Auth.request_magic_link/3 then dispatches via Chimeway on success.