Liking cljdoc? Tell your friends :D

wagoe.webhooks

What a receiver needs to check a Wagoe webhook, with no other part of the library loaded.

(webhooks/verify-signature secret raw-body (get-in request [:headers "wagoe-signature"]))

Verify against the raw body, before parsing it: re-serialised JSON is not the bytes that were signed. Use the Wagoe-Event-Id header to drop deliveries already handled — a retry after a lost response sends the same event again.

What a receiver needs to check a Wagoe webhook, with no other part of the
library loaded.

  (webhooks/verify-signature secret raw-body
                             (get-in request [:headers "wagoe-signature"]))

Verify against the raw body, before parsing it: re-serialised JSON is not
the bytes that were signed. Use the `Wagoe-Event-Id` header to drop
deliveries already handled — a retry after a lost response sends the same
event again.
raw docstring

wagoe.webhooks.core.delivery

Which subscriptions an event goes to, what is sent, and what an attempt's outcome means. Pure: the clock, ids and I/O come from the shell.

Which subscriptions an event goes to, what is sent, and what an attempt's
outcome means. Pure: the clock, ids and I/O come from the shell.
raw docstring

wagoe.webhooks.core.signature

The Wagoe-Signature header: t=<unix seconds>,v1=<hex HMAC-SHA256> over <t>.<body>. Signing the timestamp with the body is what stops a captured request being replayed later: the receiver refuses an old t, and cannot be handed a new t with the old signature.

The `Wagoe-Signature` header: `t=<unix seconds>,v1=<hex HMAC-SHA256>` over
`<t>.<body>`. Signing the timestamp with the body is what stops a captured
request being replayed later: the receiver refuses an old `t`, and cannot be
handed a new `t` with the old signature.
raw docstring

wagoe.webhooks.ports

Outbound webhooks: where subscriptions live, where attempts are recorded, how a request leaves the process, and what the rest of an application calls.

Outbound webhooks: where subscriptions live, where attempts are recorded,
how a request leaves the process, and what the rest of an application calls.
raw docstring

wagoe.webhooks.schema

Malli schemas for subscriptions and the module's settings.

Malli schemas for subscriptions and the module's settings.
raw docstring

wagoe.webhooks.shell.crypto

Signing secrets at rest. They cannot be hashed — signing needs the plaintext — so they are AES-256-GCM encrypted, in the enc:v1: format the user module uses for MFA seeds.

Signing secrets at rest. They cannot be hashed — signing needs the
plaintext — so they are AES-256-GCM encrypted, in the `enc:v1:` format the
user module uses for MFA seeds.
raw docstring

wagoe.webhooks.shell.http-transport

IWebhookTransport over Apache HttpClient: bounded connect and request timeouts, redirects and retries off, and at most max-response-bytes of the answer read.

Apache rather than java.net.http because it takes a DNS resolver: a request carrying :addresses connects to those, while the Host header, TLS SNI and certificate hostname check still use the URL's host.

`IWebhookTransport` over Apache HttpClient: bounded connect and request
timeouts, redirects and retries off, and at most `max-response-bytes` of the
answer read.

Apache rather than java.net.http because it takes a DNS resolver: a request
carrying `:addresses` connects to those, while the Host header, TLS SNI and
certificate hostname check still use the URL's host.
raw docstring

wagoe.webhooks.shell.module-wiring

Integrant wiring for outbound webhooks.

:wagoe/webhooks the IWebhooks service :wagoe.webhooks/db-schema creates the tables when migrate up has not :wagoe.webhooks/job-handlers {:webhooks/deliver handler} for the job registry :wagoe.webhooks/subscriber listens on the bus :topics and dispatches

Needs the jobs module; :topics needs the events module. Events published through the outbox reach the bus only after their transaction commits, so a rolled-back change sends no webhook.

Integrant wiring for outbound webhooks.

:wagoe/webhooks                 the `IWebhooks` service
:wagoe.webhooks/db-schema       creates the tables when `migrate up` has not
:wagoe.webhooks/job-handlers    `{:webhooks/deliver handler}` for the job registry
:wagoe.webhooks/subscriber      listens on the bus `:topics` and dispatches

Needs the jobs module; `:topics` needs the events module. Events published
through the outbox reach the bus only after their transaction commits, so a
rolled-back change sends no webhook.
raw docstring

wagoe.webhooks.shell.persistence

ISubscriptionStore and IDeliveryLog on the application database, and the boot step that creates their tables.

`ISubscriptionStore` and `IDeliveryLog` on the application database, and the
boot step that creates their tables.
raw docstring

wagoe.webhooks.shell.service

IWebhooks: subscriptions in, one job per delivery out, one log row per attempt.

`IWebhooks`: subscriptions in, one job per delivery out, one log row per
attempt.
raw docstring

wagoe.webhooks.shell.ssrf

Refusing webhook targets inside the network the application runs in.

A webhook URL is chosen by whoever creates the subscription, and the request is made from the server: without this, a tenant could point one at the cloud metadata endpoint or an internal admin port and read the answer in the delivery log.

Checked at create time and again before every attempt, because DNS can change in between. The attempt connects to the addresses that check approved, so a name that answers differently a second time (DNS rebinding) gets no second lookup. :allowed-hosts is the way to reach a private host on purpose.

Refusing webhook targets inside the network the application runs in.

A webhook URL is chosen by whoever creates the subscription, and the request
is made from the server: without this, a tenant could point one at the cloud
metadata endpoint or an internal admin port and read the answer in the
delivery log.

Checked at create time and again before every attempt, because DNS can
change in between. The attempt connects to the addresses that check
approved, so a name that answers differently a second time (DNS rebinding)
gets no second lookup. `:allowed-hosts` is the way to reach a private host
on purpose.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close