The behaviour that carries a signing link or a signing code to the signer,
by the request's delivery_channel (email or sms; the host decides what
each means).
Each delivery answers :ok, {:error, :retry} for a transient failure the
caller may retry, or {:error, {:permanent, reason}}, which marks a
pending request failed (failed_reason) and audits and notifies :fail
(Countersign.Requests.deliver_link/3, request_code/2).
Summary
Callbacks
Sends the six-digit signing code to the request's address.
Sends the signing link url to the request's address. Countersign fills
the request's virtual, redacted address field with the decrypted address
before it calls any callback of this behaviour.
Whether the request's address can still be reached on its channel (for
example, a phone number that has not opted out). Answers :ok or
{:error, reason}.
Types
@type link_kind() :: :initial | :reminder
Whether a link is the first send (or a resend) or the reminder.
@type result() :: :ok | {:error, :retry} | {:error, {:permanent, term()}}
Callbacks
@callback deliver_code(Countersign.Request.t(), code :: String.t()) :: result()
Sends the six-digit signing code to the request's address.
@callback deliver_link(Countersign.Request.t(), url :: String.t(), link_kind()) :: result()
Sends the signing link url to the request's address. Countersign fills
the request's virtual, redacted address field with the decrypted address
before it calls any callback of this behaviour.
@callback reachable(Countersign.Request.t()) :: :ok | {:error, term()}
Whether the request's address can still be reached on its channel (for
example, a phone number that has not opted out). Answers :ok or
{:error, reason}.