feat(core-audit): TraceIdEnrichingAuditLog decorator for OTel correlation

Decorator implementing IAuditLog that auto-populates AuditEntry.correlationId
from the active OTel span via currentTraceId(). Caller-supplied correlationId
always wins (explicit > implicit). eraseSubject passes through unmodified.
Adds @opentelemetry/{api,sdk-trace-base,context-async-hooks} as devDeps for
test infrastructure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 16:29:15 +02:00
parent 098fcd0d51
commit 07548c4620
3 changed files with 141 additions and 1 deletions

View File

@@ -25,9 +25,15 @@
"payload": "^3.0.0"
},
"peerDependenciesMeta": {
"payload": { "optional": true }
"payload": {
"optional": true
}
},
"devDependencies": {
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.55.0",
"@opentelemetry/context-async-hooks": "^1.28.0",
"@opentelemetry/sdk-trace-base": "^1.27.0",
"@repo/core-eslint": "workspace:*",
"@repo/core-testing": "workspace:*",
"@repo/core-typescript": "workspace:*",