Skip to content

src/dazzle_back/runtime/jwt_middleware.py

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

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

JWT Bearer token middleware for FastAPI.

Provides authentication middleware that validates JWT tokens from mobile clients.

Key Exports

  • JWTAuthContext
  • JWTMiddleware
  • create_jwt_dependency
  • create_optional_jwt_dependency
  • DualAuthMiddleware
  • create_dual_auth_dependency
  • user_id
  • email
  • roles
  • tenant_id
  • get_auth_context
  • get_jwt_auth
  • get_auth_context
  • get_dual_auth

Dependencies

Imports

  • __future__.annotations
  • collections.abc.Awaitable
  • collections.abc.Callable
  • typing.TYPE_CHECKING
  • typing.Any
  • pydantic.BaseModel
  • pydantic.Field
  • dazzle_back.runtime._fastapi_compat.FASTAPI_AVAILABLE
  • dazzle_back.runtime._fastapi_compat.FastAPIRequest
  • dazzle_back.runtime.jwt_auth.JWTClaims
  • dazzle_back.runtime.jwt_auth.JWTError
  • dazzle_back.runtime.jwt_auth.JWTService
  • fastapi.HTTPException
  • fastapi.HTTPException

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

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

Notes

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