audit.go
1 package memory 2 3 // AuditLogger is the structured-event sink used by the memory subsystem. 4 // Daemon supplies a real audit-backed adapter (see internal/daemon/memory_audit.go); 5 // tests pass an AuditFunc or a capturing stub. Implementations MUST NOT log 6 // raw API key bytes — see the boolean-only convention enforced by audit_test.go. 7 type AuditLogger interface { 8 Log(event string, fields map[string]any) 9 } 10 11 // AuditFunc adapts a plain function into AuditLogger. 12 type AuditFunc func(event string, fields map[string]any) 13 14 func (f AuditFunc) Log(event string, fields map[string]any) { f(event, fields) }