mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
docs(audit): say why two import refusals stay audit rows
The export imports log a refused upload as a signal. The admin import and the medication intake import kickoff keep audit rows on purpose: one is an administrator acting on another account, the other is shown to the record's owner in the activity feed.
This commit is contained in:
1 parent
9a5c2b8ec1
commit
742705eadd
2 files changed
+8
No files matched your search
@@ -55,6 +55,10 @@ export const POST = apiHandler(async (request: NextRequest) => {
|
||||
throw new HttpError(429, "Too many import uploads, try again later");
|
||||
}
|
||||
|
||||
// A refused upload is an audit row here, not the signal the user-facing
|
||||
// import routes emit for the same refusals: this is an administrator
|
||||
// acting on another person's account, and every attempt at that, refused
|
||||
// ones included, belongs in the trail an operator reviews.
|
||||
const declaredBytes = Number(request.headers.get("content-length") ?? 0);
|
||||
if (declaredBytes > MAX_UPLOAD_BYTES) {
|
||||
await auditLog("admin.import-apple-health.kickoff.denied", {
|
||||
|
||||
Reference in new issue
Block a user