Skip to content

feat(webhooks): add linear verification scheme - #947

Open
kai-jmi wants to merge 1 commit into
yc-software:mainfrom
kai-jmi:linear-webhook-scheme
Open

feat(webhooks): add linear verification scheme#947
kai-jmi wants to merge 1 commit into
yc-software:mainfrom
kai-jmi:linear-webhook-scheme

Conversation

@kai-jmi

@kai-jmi kai-jmi commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What

Adds a linear webhook verification scheme, alongside the existing github, slack, stripe and generic hmac-sha256 schemes.

Linear signs the raw request body with HMAC-SHA256 using the webhook signing secret and sends the hex digest in the linear-signature header, with a webhookTimestamp (ms epoch) embedded in the signed payload for replay protection. The generic hmac-sha256 scheme cannot verify these deliveries because it reads x-signature, so Linear webhooks currently cannot be verified at all.

How

  • src/webhooks/verifiers.ts: new linear verifier. Constant-time signature check over the raw body; when the signed payload carries a numeric webhookTimestamp, deliveries outside a one-minute window are rejected (Linear's documented recommendation). Payloads without a parseable timestamp pass on signature alone. Dedup key is the signed body hash, consistent with the other schemes (the linear-delivery header is unsigned, so a replay with a fresh id still dedups).
  • src/types.ts: "linear" added to the scheme union. WEBHOOK_SCHEMES derives from the verifier map, so API validation picks it up automatically.
  • plugins/web-ui/src/webhooks.ts: Linear entry in the scheme selector with guidance text.

Verified

  • node --test test/webhook-verifiers.test.ts: 14 pass (3 new: valid/forged signature, stale vs absent webhookTimestamp, dedup on signed body ignoring linear-delivery).
  • tsc --noEmit on the root and the web-ui plugin: no new errors.
  • eslint + oxlint on the touched files: clean.

The web-ui change adds one entry to the existing data-driven scheme list; markup and styles are untouched, so it renders identically to the four existing entries. No screenshot for that reason.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Linear signs the raw request body with HMAC-SHA256 into the
linear-signature header and embeds a webhookTimestamp in the signed
payload. The generic hmac-sha256 scheme cannot verify these deliveries
because it reads x-signature, so give Linear its own scheme: signature
check plus a one-minute webhookTimestamp replay window, deduplicated on
the signed body like the other schemes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant