Skip to content

src/dazzle_back/runtime/grant_store.py

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

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Runtime grant store for dynamic RBAC grants.

Manages the _grants and _grant_events tables on PostgreSQL, providing CRUD operations with atomic status transitions and audit event logging.

Requires: psycopg >= 3.2

Key Exports

  • GrantStatus
  • GrantStore
  • create_grant
  • approve_grant
  • reject_grant
  • cancel_grant
  • revoke_grant
  • has_active_grant
  • list_grants
  • expire_stale_grants

Dependencies

Imports

  • json
  • datetime.UTC
  • datetime.datetime
  • enum.StrEnum
  • typing.Any
  • uuid.UUID
  • uuid.uuid4

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: Grant {grant_id} not found
  • Validates: Cannot {event_type} grant in status

Tests

  • tests/unit/test_grant_store.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.