Migration Guides (v1 -> v2) — Auditing
Concrete upgrade steps between published NuGet major versions v1.0.0 → v2.0.0 (BC-001–BC-015 in CHANGELOG.md).
Migrating v1.0.0 to v2.0.0 (BC-001–BC-015)
Section titled “Migrating v1.0.0 to v2.0.0 (BC-001–BC-015)”- Strongly-typed
TenantId(BC-001–BC-003):Also update any switch cases or attributes expectingv1.0.0 // var query = new AuditQuery { TenantId = "tenant-acme" };// v2.0.0var query = new AuditQuery { TenantId = new TenantId("tenant-acme") };const string SystemTenantIdto reference thestatic readonly TenantIdfield at runtime. - Opaque cursor properties (
BC-004): ReplaceAfterRecordIdonAuditQuerywithContinuationToken, andNextCursorIdonAuditQueryResultwithNextPageToken. - Async enrichers and sanitizers (
BC-005): SynchronousApply(...)andSanitize(...)methods on enricher/sanitizer contracts becameApplyAsync(...)andSanitizeAsync(...). - Length-prefixed HMAC integrity (
BC-006):HmacAuditIntegrityServiceswitches to length-prefixed binary framing. Records hashed underv1.0.0will not matchv2.0.0hashes unless verified with a legacy strategy during rollover. - SQL schema & identifier validation (
BC-007–BC-015): Apply thev2.0.0schema migration addingidempotency_keyand the(tenant_id, previous_hash)index, and ensure custom table/schema names match strict SQL identifier regex validation.
Note on Unreleased Local v3.0.0–v3.1.0 (BC-016–BC-020)
Section titled “Note on Unreleased Local v3.0.0–v3.1.0 (BC-016–BC-020)”The local repository working tree (3.1.0) introduces IAuditRecordWriter/IAuditRecordReader segregation, a 4th optional TotalCount parameter on AuditQueryResult, SensitivityAuditStoreDecorator, fail-closed SQL Server RLS, and AES-GCM DLQ support. Avoid positional 3-element deconstruction of AuditQueryResult so your code remains forward-compatible.