Skip to content

chore: streamline webhook reconciliation guide - #133

Open
MantisClone wants to merge 1 commit into
08-31-chore_document_current_webhook_deliveryfrom
08-31-chore_streamline_webhook_reconciliation_guide
Open

chore: streamline webhook reconciliation guide#133
MantisClone wants to merge 1 commit into
08-31-chore_document_current_webhook_deliveryfrom
08-31-chore_streamline_webhook_reconciliation_guide

Conversation

@MantisClone

@MantisClone MantisClone commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Problem

Webhook reconciliation repeats an obsolete event catalog and handler examples, so it can diverge from the current webhook contract.

REQ-420

Proposed Solution

  • Point integrators to the Webhooks reference for events, recipients, payloads, and legacy integrations.
  • Update the Express example for current Secure Payment and orchestrator events.
  • Keep verified test deliveries from changing application state and retain raw-body signature verification and delivery-id idempotency.

Considerations

  • This stacks on #132 and keeps the existing page and navigation structure.
  • It describes public API behavior from the current webhook-delivery work. This documentation should merge only after that behavior is included in the public API release.
  • The platform and orchestrator registration instructions remain in the Webhooks reference; this page is a handler tutorial.

UAT

  1. Open the PR preview. The event-selection section should link to the canonical reference for current events, recipients, payloads, and legacy integrations.
  2. Inspect the Express handler. It should verify the raw body before parsing, return 200 for a verified x-request-network-test: true delivery before handleEvent, and pass x-request-network-delivery to each business operation.
  3. Confirm that the example covers client_id.linked, payment.confirmed, payment.failed, kyt.screening.completed, secure_payment.user_event, and secure_payment.access_rejected, and that the setup note distinguishes the platform and orchestrator signing secrets.

MantisClone commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR consolidates webhook event guidance into the canonical reference and updates the reconciliation example for platform and orchestrator deliveries.

  • Adds separate signing-secret configuration and raw-body verification across both endpoint roles.
  • Prevents verified test deliveries from reaching state-changing handlers.
  • Refreshes event routing and preserves delivery-ID idempotency guidance.

Confidence Score: 4/5

The PR is not yet safe to merge because the shared callback example discards the endpoint owner that authenticated each delivery.

The handler accepts either role's signature but collapses the result to a boolean, leaving downstream processing unable to distinguish platform and orchestrator registration context for shared event types.

Files Needing Attention: use-cases/webhook-reconciliation.mdx

Important Files Changed

Filename Overview
use-cases/webhook-reconciliation.mdx Updates the reconciliation tutorial for dual-role webhook verification and current events, but loses the matched endpoint-owner context before business dispatch.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[Platform delivery] --> V[Verify against configured secrets]
  O[Orchestrator delivery] --> V
  V --> M[Retain matching endpoint owner]
  M --> T{Test delivery?}
  T -->|Yes| A[Acknowledge without state change]
  T -->|No| H[Handle event with delivery ID and owner context]
Loading

Reviews (3): Last reviewed commit: "chore: streamline webhook reconciliation..." | Re-trigger Greptile

Comment thread use-cases/webhook-reconciliation.mdx Outdated
@MantisClone
MantisClone force-pushed the 08-31-chore_streamline_webhook_reconciliation_guide branch 2 times, most recently from 2a1df99 to 88cffbb Compare August 31, 2026 21:22
@MantisClone
MantisClone force-pushed the 08-31-chore_document_current_webhook_delivery branch from 99ee7ae to ff1fc71 Compare September 1, 2026 03:52
@MantisClone
MantisClone force-pushed the 08-31-chore_streamline_webhook_reconciliation_guide branch from 88cffbb to af0d8b1 Compare September 1, 2026 03:52
@MantisClone
MantisClone force-pushed the 08-31-chore_document_current_webhook_delivery branch from ff1fc71 to 05f8bd3 Compare September 1, 2026 03:57
@MantisClone
MantisClone force-pushed the 08-31-chore_streamline_webhook_reconciliation_guide branch from af0d8b1 to d37f43f Compare September 1, 2026 03:58
@MantisClone
MantisClone force-pushed the 08-31-chore_streamline_webhook_reconciliation_guide branch from d37f43f to b138663 Compare September 1, 2026 04:04
@MantisClone
MantisClone force-pushed the 08-31-chore_streamline_webhook_reconciliation_guide branch from b138663 to 63fbe52 Compare September 1, 2026 04:07
@MantisClone
MantisClone marked this pull request as ready for review September 1, 2026 04:08
const matches = WEBHOOK_SECRETS.map((secret) =>
signatureMatches(rawBody, signature, secret),
);
return matches.some(Boolean);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Endpoint owner context is lost

When one callback URL receives events for both a platform and an orchestrator, matchesKnownSignature reduces the matching secret to a boolean and passes no endpoint-owner identity to handleEvent, causing shared event types to be routed without knowing which registration authenticated the delivery.

Knowledge Base Used:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants