How signing works
- AeoNut builds the full JSON body: the envelope with
datainside it - The JSON string is signed using HMAC-SHA256 with your webhook’s
signing_secretas the key - The signature is sent in the
X-Webhook-Signatureheader, prefixed withsha256=
timestamp in the body changes on every retry.
Verification steps
1
Extract the signature header
Read the
X-Webhook-Signature header from the incoming request.2
Compute the expected signature
Calculate
sha256= + HMAC-SHA256 of the raw request body using your signing secret.3
Compare in constant time
Use a timing-safe comparison function to prevent timing attacks.
Code examples
- Node.js
- Python
- PHP
- Go
HTTP headers
Every webhook delivery includes these headers:Idempotency
TheX-Webhook-Delivery header carries a UUID for each delivery of an event. The automatic retries of that event keep the same ID, so you can use it to skip an event you’ve already handled, for example when your server handled the event but didn’t return a 2xx in time and AeoNut tried again.
A manual Resend from the delivery log is different. It sends the original event data in a fresh envelope with a new delivery ID, so it won’t match the ID you stored. If a resent event could cause you trouble, it helps to also dedupe on something in the payload, like the event type plus the resource ID in data.
Security best practices
Always verify signatures
Never process a webhook without verifying the signature first.
Use HTTPS
AeoNut also delivers to plain HTTP URLs, but only HTTPS keeps the payload private on the way to your server.
Use constant-time comparison
Avoid
== or === for signature comparison. Use timingSafeEqual, hmac.compare_digest, or hash_equals.Store secrets securely
Keep your signing secret in environment variables or a secrets manager, never in source code.