feat: add X-Request-Id header to outbound webhook deliveries#582
Merged
greatest0fallt1me merged 1 commit intoJun 29, 2026
Merged
Conversation
- Add test for X-Request-Id propagation when request context exists - Add test for omitting X-Request-Id when no context is set - Add comprehensive test for all webhook headers - Update webhooks.md documentation to include all outbound headers closes CalloraOrg#511
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Webhook Request-Id Header Implementation
Summary
This change adds the
X-Request-Idheader to outbound webhook deliveries, enabling request correlation across the Callora platform.Changes Made
1. Implementation (
src/webhooks/webhook.dispatcher.ts)The implementation already existed in the codebase. The
dispatchWebhookfunction:getRequestId()from the async contextX-Request-Idheader when a request context is available2. Tests (
src/webhooks/webhook.dispatcher.test.ts)Added two new test cases:
X-Request-Idis included when request context existsX-Request-Idis undefined when no request context is set3. Documentation (
docs/webhooks.md)Updated the webhook documentation to include
X-Request-Idin the headers table:X-Request-Idas a correlation ID headerUser-Agent,X-Callora-Event,X-Callora-Delivery,Content-TypeExpected Headers
All outbound webhook requests now include:
Content-TypeUser-AgentX-Callora-EventX-Callora-TimestampX-Callora-DeliveryX-Request-IdX-Callora-SignatureTesting
Run the webhook dispatcher tests:
npm test -- src/webhooks/webhook.dispatcher.test.tsSecurity Considerations
closes #511