Tells other places of each entry when it is published: the :webhooks
feature. The admin adds them in Settings:
- a webhook - a POST of the entry as JSON, signed with its secret
(
x-tayori-signature: sha256=<hex HMAC of the body>); - Slack - a message to an incoming webhook URL;
- Discord - a message to a channel webhook URL.
Their URLs and secrets are kept encrypted, as the AI key is (a :vault
or the :secret_key_base of Tayori.Config). A failed delivery is
tried again (Tayori.Jobs), unless the place refused it for good.
A webhook gets every entry, for everyone or not; Slack and Discord get the entries for everyone, which are public.
Summary
Functions
Adds a place: a kind, a name, an https URL and, for a webhook, a secret to sign with (one is made when none is given). Returns the secret.
The kinds of places.
The places, without their secrets: %{"id", "kind", "name", "host"},
where host shows where it goes without the secret part of the URL.
Removes a place.
Sends a test message to a place, and returns how it went.
Types
Functions
@spec add(String.t(), String.t(), String.t(), String.t() | nil) :: {:ok, String.t() | nil} | {:error, atom()}
Adds a place: a kind, a name, an https URL and, for a webhook, a secret to sign with (one is made when none is given). Returns the secret.
@spec kinds() :: [String.t()]
The kinds of places.
@spec list() :: [map()]
The places, without their secrets: %{"id", "kind", "name", "host"},
where host shows where it goes without the secret part of the URL.
@spec remove(String.t()) :: :ok
Removes a place.
Sends a test message to a place, and returns how it went.