Skip to content

src/dazzle_back/runtime/audit_log.py

Generated: 2026-03-30T04:38:46.824250+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Audit logging for access control decisions.

Provides async, non-blocking audit trail for all authorization decisions, following the _dazzle_event_outbox pattern. PostgreSQL only.

Key Exports

  • AuditDecision
  • AuditLogger
  • create_audit_context_from_request
  • measure_evaluation_time
  • start
  • stop
  • log_decision
  • query_logs
  • query_entity_logs
  • query_stats

Dependencies

Imports

  • asyncio
  • logging
  • time
  • dataclasses.dataclass
  • typing.Any
  • uuid.uuid4
  • json
  • datetime.UTC
  • datetime.datetime
  • datetime.UTC
  • datetime.datetime
  • datetime.timedelta
  • psycopg
  • psycopg.rows.dict_row

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_audit_log.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.