Skip to content

Signatures

Verify X-Evoriqa-Signature as an HMAC-SHA256 over the raw request body, with constant-time comparison — in Node and Python.

Your endpoint URL is reachable by anyone who learns it. The signature is what tells a genuine delivery from a forged one, so verify every request before acting on it.

How the signature is computed

The secret is the whsec_… value shown once when you created the endpoint.

Danger:

Verify against the raw bytes of the request body, exactly as received. If your framework parses the JSON and you re-serialise it to verify, key order and whitespace can differ from what was signed and every verification fails — or, worse, appears to work in testing and fails on one unusual payload. Capture the raw body before parsing.

Compare with a constant-time comparison. A plain === leaks timing information that can be used to forge a signature byte by byte.

Verifying

A checklist

  • [ ] Read the raw body before any JSON parsing.
  • [ ] Recompute the HMAC with the endpoint's own secret.
  • [ ] Compare in constant time.
  • [ ] Reject with 401 on a mismatch — do not process the payload.
  • [ ] Only then parse and act.

Rotating a secret

A secret is per endpoint. To rotate, register a new endpoint with the new secret, run both for as long as it takes to deploy the change, then delete the old one. Deliveries always use the endpoint's current secret at send time.

Where to go next

Last updated