Härtung: Login-Drosselung je IP/Konto, Mail-Anhangfehler ohne Retry, doppeltes Upload-Audit
- rate-limit: neuer Scope login (20/15 min, LOGIN_RATE_LIMIT_PER_15_MIN) je IP und je Konto; geprüft in verifyIdentityPassword (Login-Seite + Credentials-Provider), gedrosselt verhält sich wie Fehlanmeldung (generisch, konstante Laufzeit) – L10a - mail/worker: MailAttachmentError wie MailNotConfiguredError unrecoverable (fremder Mandant/Prüfsumme/Größe ändern sich nicht durch Warten) – L11 - field/uploads: Dokument-Audit nur noch in storeFile (vorher doppelt) – L10a - Test test-login-rate-limit Gate 65/65 grün; komplette Suite mit RLS_ENFORCED=true 65/65 grün. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { storage } from "@/server/storage/adapter";
|
||||
import { dispatchJob } from "@/server/jobs/dispatch";
|
||||
import { JOB_QUEUES } from "@/server/jobs/queues";
|
||||
import { ServiceError, type ServiceCtx } from "@/server/services/context";
|
||||
import { audit, isUniqueViolation, requireFieldOrder } from "./common";
|
||||
import { isUniqueViolation, requireFieldOrder } from "./common";
|
||||
import { storeFile } from "@/server/services/documents/store";
|
||||
import { sniffMime } from "./mime";
|
||||
|
||||
@@ -91,13 +91,6 @@ export async function storeFieldUpload(
|
||||
}
|
||||
}
|
||||
|
||||
await audit(ctx, "create", "document", doc.id, null, {
|
||||
workOrderId: wo.id,
|
||||
category: doc.category,
|
||||
fileName: doc.fileName,
|
||||
mimeType: doc.mimeType,
|
||||
fileSize: doc.fileSize,
|
||||
checksum: doc.checksum,
|
||||
});
|
||||
// The document `create` audit is written by services/documents/store.ts#storeFile.
|
||||
return { documentId: doc.id, duplicate: false };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user