auth-fixes #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "auth-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Resolve
{ENV_VAR}placeholders in the OpenAPI spec before serving it. Replace the monolithicx-introspect-urlextension with composablex-server-url+ individualx-*-pathfields so auth endpoints are configurable per-environment without hardcoding.Changes
openapi_first/app.py— add_resolve_spec_env_vars()that replaces{ENV_VAR}patterns (e.g.{AUTH_SERVER}) with the corresponding OS environment variable before returning the spec JSON. Called in__init__after spec load.openapi_first/security.py— build the introspection URL dynamically fromx-server-url+x-introspect-pathextensions on thebearerAuthsecurity scheme, instead of reading a singlex-introspect-url.Migration
Existing specs using
x-introspect-url: "https://auth.example.com/introspect"must switch to the new extension format:- security.py: parse securitySchemes, resolve {ENV_VAR} from env, generate FastAPI Depends for Bearer JWT introspection - app.py: extract schemes, build deps, pass to binder at init - binder.py: inject Depends() per operation based on spec's security - __init__.py: export security module - pyproject.toml: add httpx dependency- app.py: add _resolve_env and _resolve_spec_env_vars to replace {ENV_VAR} patterns (e.g. {AUTH_SERVER}) with os.environ values so the frontend receives resolved URLs via /openapi.json