hooksig / Linear
HMAC-SHA256 · hex · no timestamp
Linear
Linear signs like GitHub but ships the digest bare, with no sha256= prefix.
Try it, live in your browser
Request: edit anything
Verify this in code
import { verify } from "hooksig";
const result = await verify("linear", {
payload: rawBody, // the RAW body, not parsed JSON
headers: request.headers,
secret: env.WEBHOOK_SECRET,
});
if (!result.verified) {
return new Response(result.reason, { status: 400 });
}no match: signature invalid
Signed string
HMAC-SHA256( secret, signed string ) = expected
Expected vs provided
expected
provided
How it's built
The scheme
- Header
Linear-Signature - AlgorithmHMAC-SHA256
- Encodinghex
- Timestampnone, add your own if you need it
- SignsHMAC-SHA256 over the raw body, hex-encoded, bare digest with no prefix, keyed by the webhook signing secret. No timestamp.
Gotchas
- The header is the bare hex digest, with no sha256= prefix.
- The key is the webhook signing secret from the Linear settings, used verbatim.
- Sign the RAW body. Re-stringified JSON changes bytes and every check fails.
- Linear also puts a timestamp in the JSON payload; verify it against your tolerance yourself, since it is not folded into the signature.