fix(admin): refuse a restore whose payload names a different owner

The restore target came from the encrypted payload's own userId field
while the audit entry recorded the backup row's userId. A file declaring
a different account would therefore have been written into that account,
with the trail naming the one the operator selected.

Both values are in hand at that point, so compare them and refuse on
mismatch, recording both ids. Adds the first test coverage for this
route; the mismatch case fails without the guard.

Also correct the CLAUDE.md claim that every API route wraps apiHandler -
the three MCP OAuth routes deliberately use withBackgroundEvent so they
can return RFC-format error bodies, and carry the same protections by
hand.

chore(release): v1.30.20
This commit is contained in:
Marc-André Bombeck committed 2026-07-19 02:16:54 +02:00
1 parent 75943496f7
commit 3ffaf1906c
7 files changed
+162 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: HealthLog API
version: 1.30.19
version: 1.30.20
description: >-
Self-hosted personal-health-tracking PWA — public API surface for the iOS native client and external ingest.