Webhook Security
Every webhook delivery includes a signature that you should verify to ensure the request originated from RxScale and was not tampered with.Signature Verification
Each webhook request includes a signature header. Verify it by computing an HMAC-SHA256 hash of the request body using yoursigning_secret.
Example (Python)
Example (Node.js)
Best Practices
Always verify signatures
Always verify signatures
Never process webhook payloads without verifying the signature first. This protects against spoofed requests.
Use constant-time comparison
Use constant-time comparison
Always use
hmac.compare_digest (Python) or crypto.timingSafeEqual (Node.js) to prevent timing attacks.Respond quickly
Respond quickly
Return a
2xx response within 5 seconds. If you need to do heavy processing, acknowledge the webhook first, then process asynchronously.Handle duplicates
Handle duplicates
Webhook deliveries may be retried. Use the
event_type + timestamp + data.uid to deduplicate events.