The problem
Capture the raw request bytes and the signature header. Compute the expected HMAC with your server-side secret.
Design the boundary
Compare fixed-length values in constant time, reject stale timestamps and return 401 before parsing untrusted data.
Process the interaction
Persist the event only after verification, then acknowledge and queue downstream work.
Measure the outcome
Test malformed headers, stale timestamps, body mutations and secret rotation.