Skip to content

Add a webhooks demo#6

Merged
bartes merged 1 commit into
mainfrom
add-webhooks-demo
Jun 5, 2026
Merged

Add a webhooks demo#6
bartes merged 1 commit into
mainfrom
add-webhooks-demo

Conversation

@bartes

@bartes bartes commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Adds a webhooks page and receiver:

  • POST /webhooks/castle verifies the X-Castle-Signature header against the raw request body with verifyWebhookSignature; unverified requests get a 404.
  • Verified payloads are kept in memory (most recent 50) and listed on the /webhooks page, which also shows the receiver URL.

Captures the raw body via an express.json({ verify }) hook, adds the webhooks demo entry, the /webhooks and /webhooks/castle routes, and views/webhooks.pug. Jest covers the verified and rejected paths.

Adds a "webhooks" page and receiver that demonstrate how to handle
incoming Castle webhooks:

- POST /webhooks/castle verifies the X-Castle-Signature header against the
  raw body with verifyWebhookSignature; requests that fail verification get
  a 404.
- Verified payloads are kept in memory (most recent 50) and listed on the
  /webhooks page.

Includes jest coverage for both the verified and rejected paths.
@bartes bartes merged commit 08b299a into main Jun 5, 2026
2 checks passed
@bartes bartes deleted the add-webhooks-demo branch June 6, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant