Skip to content

feat(core): Make audit logger types extensible [backport to release/service/v0.25] - #3966

Merged
jakedoublev merged 2 commits into
release/service/v0.25from
backport-3089-to-release/service/v0.25
Sep 3, 2026
Merged

feat(core): Make audit logger types extensible [backport to release/service/v0.25]#3966
jakedoublev merged 2 commits into
release/service/v0.25from
backport-3089-to-release/service/v0.25

Conversation

@opentdf-automation

Copy link
Copy Markdown
Contributor

Description

Backport of #3089 to release/service/v0.25.

### 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
opentdf-automation Bot force-pushed the backport-3089-to-release/service/v0.25 branch from dd0a0ae to dae6d75 Compare September 3, 2026 15:39
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@github-actions github-actions Bot added the size/l label Sep 3, 2026
elizabethhealy
elizabethhealy previously approved these changes Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 121.729309ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 56.246023ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 285.355465ms
Throughput 350.44 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 27.54394053s
Average Latency 274.907682ms
Throughput 181.53 requests/second

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 206.278472ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 115.363757ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 444.119629ms
Throughput 225.16 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.582798262s
Average Latency 415.067297ms
Throughput 120.24 requests/second

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 221.488688ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 127.073847ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 453.813737ms
Throughput 220.35 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.576741752s
Average Latency 444.772013ms
Throughput 112.17 requests/second

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/ocrypto
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

@jakedoublev
jakedoublev merged commit 2143cf3 into release/service/v0.25 Sep 3, 2026
44 checks passed
@jakedoublev
jakedoublev deleted the backport-3089-to-release/service/v0.25 branch September 3, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants