Security
openapi_first.security
Summary
OpenAPI security scheme parsing and auto-generated auth dependencies.
This module reads securitySchemes and per-operation security from an
OpenAPI spec, resolves {ENV_VAR} placeholders in x- extension fields,
and generates FastAPI dependencies for token validation (e.g., Bearer JWT
introspection).
Functions
make_security_dependencies
Build a mapping of METHOD:/path → list of Depends(...).
The effective security for each operation is resolved by:
- Using the operation-level
securityfield if present. - Falling back to the top-level
securityfield. - An empty list means no auth required for that operation.