Kantoor. Karta. Settings
(Kantoor v1.0.0)
Runtime settings for the Karta integration, read from
config :kantoor, Kantoor.Karta, ... on every call (so tests and runtime
config can change them).
Keys: :inbound_secrets (list of whsec_ strings), :inbound_header
({name, value} or nil), :max_body_bytes, :base_url, :api_key,
:req_options (merged into every client request, used by tests),
:client (module implementing Kantoor.Karta.Client).
The struct holds the client credentials; its Inspect implementation hides
the API key.
Summary
Functions
Client credentials, or {:error, :not_configured}.
Client credentials for one domain: the key stored on that domain when there is
one (Kantoor.Karta.Keys), else the instance key. {:error, :not_configured}
when neither is there; {:error, :karta_key_unreadable} when a key is stored
but will not decrypt (the wrong vault key) — falling back would ask the wrong
Karta organisation.
The module implementing the client behaviour.
Credentials with a named key (one the caller just received, not yet stored), for the call that stores it. The base URL is always the instance's.
Optional extra shared header as {lowercase_name, value}.
Configured endpoint secrets (whsec_...), possibly several for rotation.
Maximum accepted size of an inbound push body in bytes.
Every secret a push may be signed with: KARTA_INBOUND_SECRETS and the secrets of
the endpoints Kantoor registered itself (stored encrypted, see Kantoor.Vault).
Types
Functions
@spec client() :: {:ok, t()} | {:error, :not_configured}
Client credentials, or {:error, :not_configured}.
Client credentials for one domain: the key stored on that domain when there is
one (Kantoor.Karta.Keys), else the instance key. {:error, :not_configured}
when neither is there; {:error, :karta_key_unreadable} when a key is stored
but will not decrypt (the wrong vault key) — falling back would ask the wrong
Karta organisation.
@spec client_module() :: module()
The module implementing the client behaviour.
Credentials with a named key (one the caller just received, not yet stored), for the call that stores it. The base URL is always the instance's.
Optional extra shared header as {lowercase_name, value}.
@spec inbound_secrets() :: [String.t()]
Configured endpoint secrets (whsec_...), possibly several for rotation.
@spec max_body_bytes() :: pos_integer()
Maximum accepted size of an inbound push body in bytes.
@spec verification_secrets() :: [String.t()]
Every secret a push may be signed with: KARTA_INBOUND_SECRETS and the secrets of
the endpoints Kantoor registered itself (stored encrypted, see Kantoor.Vault).