feat(core): Make audit logger types extensible [backport to release/service/v0.25] - #3966
Merged
jakedoublev merged 2 commits intoSep 3, 2026
Merged
Conversation
3 tasks
### Proposed Changes This pull request enhances the audit logging system by introducing extensibility for audit types and refactoring the event creation process. It allows dynamic registration of new object, action, and result types, and provides a cleaner API for generating audit events through dedicated Data Transfer Objects (DTOs). This change improves flexibility for future additions and better separates internal logging mechanisms from the public API. ### Highlights * **Extensible Audit Type Registration**: Introduced new RegisterObjectType, RegisterActionType, and RegisterActionResult functions, allowing external modules to dynamically register new audit object types, action types, and action results. This enhances the extensibility of the audit logger without requiring core code modifications for new types. * **Refactored Audit Event Structure**: Refactored the internal audit event structures by introducing public Data Transfer Objects (DTOs) for EventMetaData, EventObjectObject, EventObjectAttributes, EventObjectAction, EventObjectActor, and EventClientInfo. These DTOs are now embedded within the internal event types, providing a clearer separation between internal logging mechanisms and the public API for event creation. * **Simplified Audit Event Creation**: Added a new NewEvent function that converts the public DTOs into the internal EventObject type, streamlining the process of creating audit events from external sources and improving the overall API for audit logging. ### Checklist - [ ] I have added or updated unit tests - [ ] I have added or updated integration tests (if appropriate) - [ ] I have added or updated documentation ### Testing Instructions <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added customizable audit event type names with batch registration and startup configuration. * Added a public API for creating structured audit events. * Audit registrations are validated, conflict-protected, and sealed during server startup. * **Bug Fixes** * Improved audit event and schema handling for embedded fields, ensuring values and schemas match JSON output. * **Tests** * Added coverage for registration, conflicts, sealing, event construction, nested event data, and schema behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> (cherry picked from commit ce97a2d)
opentdf-automation
Bot
force-pushed
the
backport-3089-to-release/service/v0.25
branch
from
September 3, 2026 15:39
dd0a0ae to
dae6d75
Compare
Contributor
X-Test Failure Report |
elizabethhealy
previously approved these changes
Sep 3, 2026
Contributor
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Contributor
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Contributor
policy-bot-opentdf
Bot
dismissed
elizabethhealy’s stale review
September 3, 2026 17:27
Invalidated by push of fe8745f
Contributor
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Contributor
|
Contributor
jakedoublev
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #3089 to
release/service/v0.25.