Countersign.Request (Countersign v0.1.0)

Copy Markdown View Source

A signing request (signing_requests): one invitation to one remote signer to sign one role of one subject.

The delivery address is stored encrypted (to_address), as a keyed digest (to_digest) and as a masked hint (to_hint). The link token is stored only as its SHA-256 hash (token_hash) and, encrypted, as last_token_ciphertext while the request is pending. The virtual address field holds the decrypted address only while Countersign hands the request to a Countersign.Delivery callback; it is never persisted and is redacted from inspect/2.

Summary

Functions

The delivery channels a request can use.

Days after signing that the signer may get a copy through the link.

Whether a signed request's signer may still get a copy at now: within 30 days of signed_at.

Whether the request is pending and not yet past expires_at at now.

Every status a request can hold.

Types

status()

@type status() ::
  :pending | :signed | :declined | :expired | :revoked | :superseded | :failed

t()

@type t() :: %Countersign.Request{
  __meta__: term(),
  address: String.t() | nil,
  certificate_ref: String.t() | nil,
  codes: term(),
  consent_sha256: String.t() | nil,
  consent_version: pos_integer() | nil,
  consented_at: DateTime.t() | nil,
  content_sha256: String.t() | nil,
  decline_kind: :declined | :paper_requested | nil,
  decline_reason: String.t() | nil,
  declined_at: DateTime.t() | nil,
  delivery_channel: :email | :sms | nil,
  expires_at: DateTime.t() | nil,
  failed_reason: String.t() | nil,
  id: Ecto.UUID.t() | nil,
  inserted_at: DateTime.t() | nil,
  last_sent_at: DateTime.t() | nil,
  last_token_ciphertext: binary() | nil,
  opened_at: DateTime.t() | nil,
  reminded_at: DateTime.t() | nil,
  resent_times: [DateTime.t()],
  revoke_reason: String.t() | nil,
  revoked_at: DateTime.t() | nil,
  revoked_by_ref: String.t() | nil,
  role: String.t() | nil,
  scope_id: Ecto.UUID.t() | nil,
  send_count: non_neg_integer() | nil,
  sent_by_ref: String.t() | nil,
  sign_ip: String.t() | nil,
  sign_method: :drawn | :typed | nil,
  sign_user_agent: String.t() | nil,
  signature_ref: String.t() | nil,
  signed_at: DateTime.t() | nil,
  signer_name: String.t() | nil,
  signer_ref: String.t() | nil,
  signer_relationship: String.t() | nil,
  status: status() | nil,
  subject_id: String.t() | nil,
  subject_type: String.t() | nil,
  to_address: binary() | nil,
  to_digest: binary() | nil,
  to_hint: String.t() | nil,
  token_hash: binary() | nil,
  updated_at: DateTime.t() | nil,
  verified_at: DateTime.t() | nil,
  verified_times: [DateTime.t()]
}

Functions

channels()

@spec channels() :: [:email | :sms]

The delivery channels a request can use.

copy_days()

@spec copy_days() :: pos_integer()

Days after signing that the signer may get a copy through the link.

copyable?(request, now)

@spec copyable?(t(), DateTime.t()) :: boolean()

Whether a signed request's signer may still get a copy at now: within 30 days of signed_at.

live?(request, now)

@spec live?(t(), DateTime.t()) :: boolean()

Whether the request is pending and not yet past expires_at at now.

statuses()

@spec statuses() :: [status()]

Every status a request can hold.