Skip to content

src/dazzle_back/runtime/surface_access.py

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

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Surface access control enforcement for DNR-Back applications.

Enforces access control based on SurfaceAccessSpec: - Authentication checks - Persona-based authorization (allow_personas, deny_personas) - Unauthenticated user handling (401 for API, redirect for UI)

The pure types (SurfaceAccessConfig...

Key Exports

  • get_user_personas_from_membership
  • create_access_check_handler
  • create_access_denied_handler
  • check_access
  • handle_access_denied

Dependencies

Imports

  • collections.abc.Callable
  • typing.Any
  • fastapi.Request
  • fastapi.responses.JSONResponse
  • fastapi.responses.RedirectResponse
  • starlette.responses.Response
  • dazzle_ui.runtime.surface_access.SurfaceAccessConfig
  • dazzle_ui.runtime.surface_access.SurfaceAccessDenied
  • dazzle_ui.runtime.surface_access.check_surface_access
  • fastapi.HTTPException
  • json

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/unit/test_surface_access_parsing.py
  • tests/unit/test_surface_access_enforcement.py
  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py

Notes

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