Skip to content

Commit 6818176

Browse files
committed
docs: fix audit event type examples in documentation
Update event type examples in AuditEventEnvelope docstring and test fixtures to match actual implementation using underscore notation instead of dot notation. - Change 'access_request.created' to 'access_create' - Change 'group.member_added' to 'group_member_added' - Update test fixture to use realistic event type names This ensures plugin developers see accurate examples that match the actual event types emitted by operations throughout the codebase. Signed-off-by: Jean-Philippe Lachance <[email protected]>
1 parent c569d8e commit 6818176

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/plugins/audit_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AuditEventEnvelope:
3333
3434
Attributes:
3535
id: Unique event identifier (UUID v4) for deduplication across retries
36-
event_type: Access event type (e.g., 'access_request.created', 'group.member_added')
36+
event_type: Access event type (e.g., 'access_create', 'group_member_added')
3737
timestamp: When the audited action occurred (timezone-aware UTC datetime)
3838
actor_id: WHO - User ID of the person performing the action
3939
actor_email: WHO - Email of the actor for human traceability

tests/test_audit_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def sample_envelope() -> AuditEventEnvelope:
1313
"""Create a sample audit event envelope for testing."""
1414
return AuditEventEnvelope(
1515
id=uuid4(),
16-
event_type="access_request.created",
16+
event_type="access_create",
1717
timestamp=datetime.now(timezone.utc),
1818
actor_id="user-123",
1919
actor_email="[email protected]",
@@ -32,7 +32,7 @@ class TestAuditEventEnvelope:
3232

3333
def test_envelope_creation(self, sample_envelope: AuditEventEnvelope) -> None:
3434
"""Test AuditEventEnvelope can be instantiated with all required fields."""
35-
assert sample_envelope.event_type == "access_request.created"
35+
assert sample_envelope.event_type == "access_create"
3636
assert sample_envelope.actor_id == "user-123"
3737
assert sample_envelope.actor_email == "[email protected]"
3838
assert sample_envelope.target_type == "access_request"

0 commit comments

Comments
 (0)