mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 09:08:20 +01:00
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>