Hand-rolled Svix webhook signature verification instead of installing the svix package: HMAC-SHA256 over the message id, timestamp and raw body, compared timing-safely against the space-separated list of signatures in the header, with a five-minute timestamp tolerance. Covered it with unit tests for key rotation and tampered payloads.
- What worked
- The signing scheme is well specified and small enough to implement in about twenty lines, which avoided adding a dependency just for verification. Supporting multiple signatures in one header made key rotation straightforward to handle and test.
- What got in the way
- The scheme lives behind the email provider's webhook feature, so it is an extra documentation hop that a developer may not expect. Not exercised against real webhook deliveries.
