KartaWeb.WebhookLive.Summary (Karta v1.0.0)

What the webhook pages show of a webhook: everything but its secrets.

The pages keep summaries, never the Karta.Webhooks.Webhook they read, which carries the signing secret, the previous one and the password of the URL: no secret stays in a page's state. A new secret is shown once, from what Karta.Webhooks.create/2 or Karta.Webhooks.rotate_secret/2 returned, until it is dismissed; every event reads the webhook again within the page's server.

Of the URL's credentials only the user name is kept (user); of the extra authentication header only its name (auth_header); a webhook in SendGrid's format has its public_key; previous_until is when the previous secret stops signing, while it still does; shared_with names the webhooks that sign with the same Mailgun key, each with its URL (filled by the webhook's page, Karta.Webhooks.sharing_key/1).

Summary

Functions

A delivery's state for <.state>: :retrying while pending after a failed request.

What a format sends and how it is signed, in a sentence.

A format's name.

The formats for a select: {label, format}, in Karta.Webhooks.Format.formats/0's order.

The summary of a webhook as stored (its secret read), at now.

What the secret of a webhook in the format is called: its signing secret or key.

The webhook's state for <.state>: :on, :failing (on, and its requests have failed since failing_since), :off (switched off by someone) or :stopped (switched off by Karta because its requests kept failing).

Types

t()

@type t() :: %KartaWeb.WebhookLive.Summary{
  auth_header: term(),
  disabled_at: term(),
  disabled_reason: term(),
  enabled: term(),
  events: term(),
  failing_since: term(),
  format: term(),
  host: term(),
  id: term(),
  inserted_at: term(),
  name: term(),
  previous_until: term(),
  public_key: term(),
  shared_with: term(),
  url: term(),
  user: term()
}

Functions

delivery_state(delivery)

@spec delivery_state(Karta.Webhooks.Delivery.t()) ::
  :pending | :retrying | :succeeded | :failed

A delivery's state for <.state>: :retrying while pending after a failed request.

format_help(atom)

@spec format_help(atom()) :: String.t()

What a format sends and how it is signed, in a sentence.

format_label(format)

@spec format_label(atom()) :: String.t()

A format's name.

format_options()

@spec format_options() :: [{String.t(), atom()}]

The formats for a select: {label, format}, in Karta.Webhooks.Format.formats/0's order.

new(webhook, now \\ DateTime.utc_now())

@spec new(Karta.Webhooks.Webhook.t(), DateTime.t()) :: t()

The summary of a webhook as stored (its secret read), at now.

secret_name(arg1)

@spec secret_name(atom()) :: String.t()

What the secret of a webhook in the format is called: its signing secret or key.

state(summary)

@spec state(t()) :: :on | :failing | :off | :stopped

The webhook's state for <.state>: :on, :failing (on, and its requests have failed since failing_since), :off (switched off by someone) or :stopped (switched off by Karta because its requests kept failing).