From cbec4753a1ecab2000b130acb3adcc6e7c34587e Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Wed, 4 Nov 2026 13:33:58 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20types(audit):=20excludeFields=20und?= =?UTF-8?q?=20AuditEntry=20(#67)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit collection.audit.excludeFields (dot notation) hält Werte aus dem Audit-Verlauf heraus; AuditLog.redactedFields nennt die betroffenen Pfade. AuditEntry ist jetzt als Typ deklariert, damit Clients das Feld sehen. Refs cms/tibi-server#67 --- index.d.ts | 27 +++++++++++++++++++++++++++ schemas/config/collection.schema.json | 8 ++++++++ 2 files changed, 35 insertions(+) diff --git a/index.d.ts b/index.d.ts index 190bd8c..85017a2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -272,6 +272,33 @@ declare global { | "bulkUpdate" | "bulkDelete" > + /** + * Document paths (dot notation, e.g. `security.twoFactor.secret`) whose + * values are never written to the audit history. The values are dropped, + * not replaced: the paths are recorded in `AuditEntry.redactedFields` + * instead, so a client-side audit restore cannot write a placeholder into + * the document. Snapshot backups (`snapshotPath`) are not affected. + */ + excludeFields?: string[] + } + + /** One audit history entry as returned by `GET /api/v1/audit`. */ + export interface AuditEntry { + id?: string + projectNamespace?: string + projectName?: string + collection: string + action: string + documentId?: string + snapshot?: Record + changes?: Record + filter?: Record + /** + * Paths removed from `snapshot`/`changes` because the collection lists + * them in `audit.excludeFields`. Metadata only — the values are gone. + */ + redactedFields?: string[] + [key: string]: any } export interface UploadConfig { diff --git a/schemas/config/collection.schema.json b/schemas/config/collection.schema.json index 623a0c6..8cad41c 100644 --- a/schemas/config/collection.schema.json +++ b/schemas/config/collection.schema.json @@ -124,6 +124,14 @@ "bulkDelete" ] } + }, + "excludeFields": { + "description": "Document paths (dot notation) whose values are never stored in the audit history. The paths are recorded in AuditLog.redactedFields; snapshot backups are not affected.", + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } },