How it works
Each delivery carries anX-Get2Dial-Signature header in the form:
t is the Unix timestamp the request was signed at. v1 is an HMAC-SHA256 signature, hex
encoded, computed over <timestamp>.<raw request body>, keyed with your webhook’s signing
secret.
Steps
crypto.timingSafeEqual, hmac.compare_digest) rather than === or ==, which leaks
timing information an attacker can use to guess the signature byte by byte.
Verify
Send yourself a test event and confirm your verification function returns
true for a
genuine delivery and false for a payload you’ve tampered with.Common problems
- Verification always fails. Confirm you’re signing the raw request body — not a re-serialized version of the parsed JSON, which can differ in whitespace or key order and produce a different signature.
- You need replay protection. Implement your own timestamp-freshness check against
t— it isn’t enforced by Get2Dial.