mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 23:12:04 +00:00
fix(deploy-webhook): accept signed requests and stop calling a bare timestamp replay protection
The deploy-status webhook authenticated with a static secret in a header, and the timestamp the docs called replay protection was covered by nothing: whoever captures one request holds the secret and can send a fresh request with any content. The strict setting, documented as closing the replay window completely, only made that timestamp mandatory. A sender can now sign instead: X-Deploy-Webhook-Signature is the HMAC-SHA256 of the timestamp and the exact body under the shared secret, with the timestamp within five minutes, and the secret never travels. The strict setting accepts only signed requests. The secret header still works by default for senders that cannot sign, and the docs describe its timestamp as the staleness hint it is.
This commit is contained in:
1 parent
807d483b89
commit
f2a9b0fc0e
5 files changed
+204
-71
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$comment": "safeJson calls per route file under src/app; new body-reading routes use parseJsonBody. Maintained by src/__tests__/route-body-parse-ratchet.test.ts.",
|
||||
"count": 61,
|
||||
"total": 61,
|
||||
"count": 60,
|
||||
"total": 60,
|
||||
"entries": {
|
||||
"app/api/admin/ai-settings/route.ts": 1,
|
||||
"app/api/admin/drain-per-sample-cumulative/route.ts": 1,
|
||||
@@ -37,7 +37,6 @@
|
||||
"app/api/insights/generate/route.ts": 1,
|
||||
"app/api/insights/layout/route.ts": 1,
|
||||
"app/api/integrations/healthkit/route.ts": 1,
|
||||
"app/api/internal/deploy-webhook/route.ts": 1,
|
||||
"app/api/labs/ocr/extract/route.ts": 1,
|
||||
"app/api/measurements/batch/route.ts": 1,
|
||||
"app/api/measurements/by-external-ids/route.ts": 1,
|
||||
|
||||
Reference in new issue
Block a user