Webhook Signature Verification
Use this skill when signing or verifying webhook payloads.
1. Provider
Sign the raw body bytes (not re-serialized JSON) with HMAC-SHA256 (or documented scheme). Include timestamp in the signed content. Rotate secrets.
2. Receiver
- Read raw body before JSON parse.
- Compute expected HMAC; constant-time compare.
- Reject if timestamp outside skew window (replay).
- Dedupe on event id (idempotent processing).
3. Quick checklist
- Raw body signed/verified.
- Constant-time compare.
- Timestamp window enforced.
- Secrets not logged; rotation supported.
- Idempotent event handling.
See reference.md and examples.md.