Authentication
Verify every delivery before parsing or acting on its JSON. Toden signs the exact request bytes with the secret assigned to that endpoint.
Signed headers
Verification algorithm
- Read the raw HTTP request body as bytes.
- Parse
tand allv1values fromX-Myaza-Signature-V2. - Reject a missing, invalid, too-old or implausibly future timestamp.
- Compute lowercase hex
HMAC-SHA256("<t>.<rawBody>", endpointSecret). - Compare the expected value with every supplied
v1using a constant-time comparison. - Only after a match, parse the JSON, deduplicate on
id, enqueue it durably and return2xx.
Do not re-serialise parsed JSON before verification. Whitespace and property order change the signed bytes.
Node.js example
Secret rotation
During the configured grace period Toden signs with the active secret and every unexpired grace secret. The V2 header therefore carries more than one v1 value. Keep both endpoint secrets available and accept the request if either expected signature matches. Remove the old secret only after its dashboard grace period ends.
Failure responses
Return 401 for missing, stale or invalid signatures. Return 2xx only after the event is durably accepted. Other non-2xx responses and timeouts are retried according to the delivery schedule.