Files
loki/scripts/test
d30970b2ae refactor(orangecat): dedupe the webhook HMAC verify into one SSOT + lock it with a contract test (#95)
Both OrangeCat webhook receivers (/api/orangecat/entitlement and
/api/orangecat/events) had an identical, copy-pasted verifySignature —
a change to one could silently drift from the other, and neither was
tested. Extracted it to src/lib/integrations/orangecat-webhook.ts
(behaviour-identical: sha256=<hex> or bare hex, timing-safe) and added
scripts/test/orangecat-webhooks.ts, a cross-repo contract test that signs
bodies exactly as OrangeCat's emitter does and asserts accept/reject across
tamper, wrong-secret, missing-header, and non-hex inputs.

Pairs with orangecat #450 (the sender side). Verified: tsc 0, eslint 0,
40/40 unit tests pass.

Co-authored-by: x <x@x>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 15:49:40 +02:00
..