Project: https://github.com/TypeError/secure
Secure is a small Python library for defining HTTP security headers once and applying them consistently across web frameworks.
It provides:
- A single, typed API for configuring headers
- Presets for common configurations (balanced, strict, basic)
- ASGI and WSGI middleware for frameworks like FastAPI and Flask
- Builders for CSP and Permissions Policy
- Optional validation and normalization pipeline
The goal is to avoid copy-pasting header strings across middleware, response hooks, and framework-specific code, and instead keep a single, explicit policy.
Python 3.10+, no external dependencies.
Project: https://github.com/TypeError/secure
Secure is a small Python library for defining HTTP security headers once and applying them consistently across web frameworks.
It provides:
The goal is to avoid copy-pasting header strings across middleware, response hooks, and framework-specific code, and instead keep a single, explicit policy.
Python 3.10+, no external dependencies.