Verify signatures
Both directions carry the same header, signed with the workspace's one secret:
Code
The hex is HMAC-SHA256 over <t>.<raw body> with your secret. Three rules make it safe:
- Sign and verify the raw bytes, never a re-serialised parse.
- Compare in constant time.
- Refuse timestamps more than 5 minutes off.
During a secret rotation the header may carry two v1= entries; either one matching is enough.
A poll has no body: sign the query string exactly as sent (everything after ?,
or the empty string), so the signed text is <t>.<query>. The poll's answer is signed over its
body like a push.
Each snippet has a verify function for events Hijinks sends you (and poll answers), a sign function for events your bridge sends, and a sign function for polls.
To check your code end to end without a bridge, sign a request with openssl as in the
Quickstart.
Rotating the secret
Rotate secret in the workspace's settings shows a new secret once. The old one keeps working
for 24 hours, and every event Hijinks sends carries a v1= for each, so you can redeploy the
bridge with the new secret at leisure.
If the old secret leaked, don't wait: after rotating, press Expire the old secret now
beside the new one. From then on only the new secret verifies, in both directions, and a bridge
still holding the old one gets 401 until you redeploy it.