Preserve the raw body
<timestamp>.<raw body>. Verify before JSON parsing;
parse and reserialization can change bytes.
Reject before dispatch
t=<unix timestamp>,v1=<hex signature>. The verifier:
- refuses malformed fields;
- refuses timestamps outside the tolerance;
- computes HMAC-SHA256 with Web Crypto;
- compares equal-length signatures in constant time.
Test without a service
Build fixture signatures with Web Crypto in application tests. Keep replay tests for stale timestamps, modified bodies, wrong secrets and malformed headers.Continue
Security boundary
Keep secrets and trust transitions explicit.
Remote errors
Decide how invalid delivery reaches product state.
Type index
Read the remote event and error shapes.
Source
Inspect the exact verifier.