Expand description
Webhook signature verification.
The API signs every delivery with
X-OpenSMS-Signature: t=<unix seconds>,v1=<hex>, where
v1 = hex(HMAC-SHA256(secret, "<t>." + raw body)) and secret is the full
whsec_... string returned once by webhooks.create. Parsing mirrors the
server exactly. These functions need no client or API key.
Structs§
- Verify
Options - Options for
verify_signatureandconstruct_event.
Constants§
- DEFAULT_
TOLERANCE_ SECONDS - Default allowed clock skew, in seconds.
- SIGNATURE_
HEADER - The header that carries the signature.
Functions§
- construct_
event - Verify the signature, then parse the event envelope. Fails with an
OpensmsErrorwhosecodeisinvalid_signatureorexpired_signature. - verify_
signature truewhenheaderis a valid, fresh signature ofpayload(the exact raw body bytes) undersecret.