Signature header
sha256= prefix followed by the hexadecimal digest.
Verification steps
- Read the body without parsing (raw bytes/string).
- Compute
HMAC-SHA256(body, secret)in hexadecimal. - Compare with the header value without the
sha256=prefix. - Use constant-time comparison (
hmac.compare_digest,hash_equals,timingSafeEqual). - If mismatch, return 401 Unauthorized and do not process the payload.
Conceptual example (Python)
Idempotency
UseX-Kairo-Delivery as a deduplication key. Kairo Shield may retry failed deliveries.