feat(core-audit): createAuditAfterReadHook factory for opt-in VIEW capture

Adds the afterRead hook factory for per-collection opt-in automatic VIEW
audit entry emission. Fire-and-forget design ensures failing sinks never
propagate to the user-facing read. Includes sentinel IP/UA fallbacks,
truncateIp /24 integration, shouldSkip predicate, and system actor
resolution. All 6 TDD test cases pass; both barrels updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:33:59 +02:00
parent 55993a2c93
commit c06f47b81e
4 changed files with 217 additions and 0 deletions

View File

@@ -14,6 +14,11 @@ export {
createAuditErasureHook,
type AuditErasureHookOpts,
} from "./hooks/audit-erasure-hook";
// Phase 5 — VIEW capture
export {
createAuditAfterReadHook,
type AuditAfterReadHookOpts,
} from "./hooks";
export {
createAuditRouter,
auditRouter,