feat: structured logs /api/webhooks - #1354
Merged
greatest0fallt1me merged 2 commits intoJul 30, 2026
Merged
Conversation
- Added src/middleware/accessLog.ts for structured access logging - Included correlation ID generation and header propagation - Added app/api/webhooks/route.ts with boundary input validation - Added tests for middleware and route with >90% coverage - Implemented standardized error envelopes for payload validation
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.
Summary
src/middleware/accessLog.tsfor structured access loggingapp/api/webhooks/route.tswith boundary input validationSecurity Changes
Type of Security Change
Vulnerability Details (if applicable)
CVE/Advisory ID:
Affected Package:
Fix Applied:
Exemption Request (if applicable)
Exemption ID: N/A
Justification:
N/A
Mitigation Applied:
N/A
Expiry Date: N/A
Review Plan:
N/A
Testing
npm auditlocally - output attached or no new vulnerabilitiesnpm testnpm run buildSecurity Impact Analysis
Affected Components:
Risk Assessment:
This change introduces strong boundary checks to the
/api/webhooksPOST endpoint, preventing malformed JSON or unprocessable entity types from reaching downstream services. It introduces structured logging with correlation IDs mapping tox-correlation-id, which improves auditability of inbound requests without logging potentially sensitive webhook payload data (PII).Documentation Updates
Checklist
Additional Notes
The webhook payload body is intentionally excluded from the access logs to avoid accidental PII spillage.
Test Output
CI Run Link
Workflow Run:
Security Review Required: @security-team
Compliance Impact: No
closes #1112