src/dazzle_back/runtime/csrf.py¶
Generated: 2026-03-30T04:38:47.071610+00:00
Commit: 615f1354a103
Language: python
Scope: dazzle_back
Purpose¶
CSRF protection for Dazzle Backend applications.
Implements the double-submit cookie pattern using a pure ASGI middleware
(not BaseHTTPMiddleware, which has body consumption issues):
- Sets a dazzle_csrf cookie (httponly=False so JS can read it)
- On state-changing requests (POST/PUT/DELETE/PATCH...
Key Exports¶
CSRFConfigconfigure_csrf_for_profileCSRFMiddlewareapply_csrf_protectionsend_with_cookie
Dependencies¶
Imports¶
__future__.annotationsloggingsecretsdataclasses.dataclassdataclasses.fieldtyping.TYPE_CHECKINGtyping.Any
Event Interactions¶
None detected.
Invariants and Assumptions¶
No invariants documented.
Tests¶
tests/integration/test_runtime_e2e.pytests/integration/test_runtime_pipeline.pytests/unit/test_runtime_test_routes.pytests/unit/test_runtime_services.pytests/unit/test_runtime_mcp_tools.py
Notes¶
This page was automatically generated by tools/gen_reference_docs.py.