Skip to content

Add Svix, Linear, PagerDuty and Twilio webhook platform support and verification#51

Open
Prateek32177 wants to merge 1 commit intomainfrom
codex/add-webhook-signature-verification-for-providers
Open

Add Svix, Linear, PagerDuty and Twilio webhook platform support and verification#51
Prateek32177 wants to merge 1 commit intomainfrom
codex/add-webhook-signature-verification-for-providers

Conversation

@Prateek32177
Copy link
Contributor

Motivation

  • Add support for four additional webhook providers (Svix, Linear, PagerDuty, Twilio) and improve signature/header parsing to cover provider variations and edge cases.
  • Provide provider-specific protections such as Linear replay-window checks and Twilio payload hash validation.
  • Make detection and configuration more robust by allowing header aliases and alternative signature formats.

Description

  • Added new platform entries to src/types.ts and added rows to README.md to document svix, linear, pagerduty, and twilio (marked as untested in README).
  • Introduced platform configurations for svix, linear, pagerduty, and twilio in src/platforms/algorithms.ts including header names, algorithms, and custom config flags (e.g. idHeaderAliases, timestampHeaderAliases, comparePrefixed, validateBodySHA256).
  • Extended platform detection in src/index.ts to detect the new headers and disambiguate svix vs clerk when svix-signature is present with an svix-id.
  • Enhanced signature parsing and payload handling in src/verifiers/algorithms.ts to support comma-separated and prefixed variants (including v1, and v1= forms), header alias lookup for timestamps/ids, custom payload {url} formatting for Twilio, and optional comparePrefixed logic used for PagerDuty.
  • Implemented provider-specific verification helpers in src/verifiers/algorithms.ts including validateLinearReplayWindow for Linear timestamp replay protection and validateTwilioBodyHash for Twilio bodySHA256 validation, and integrated these checks into the verification flow.
  • Added helper signature generators and end-to-end tests for the new platforms in src/test.ts (createPagerDutySignature, createLinearSignature, createSvixSignature, createTwilioSignature) and appended tests (26–29) exercising PagerDuty, Linear, Svix, and Twilio verification paths.

Testing

  • Executed the automated test runner implemented in src/test.ts which includes the new tests for pagerduty, linear, svix, and twilio, and the new checks completed successfully.
  • Existing platform verification tests were re-run as part of the same suite and also passed.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant