Reputation: 8196
I have an APIFlask app that servers Swagger UI and OpenAPI spec endpoints. (/docs
and /openapi.json
, respectively.)
I have successfully implementer JWT-based Bearer auth to protect my own endpoints, but I don't see any obvious way to protect the auto-generated Swagger UI and OpenAPI spec endpoints.
Suggestions?
Upvotes: 2
Views: 141
Reputation: 153
From version 2.1.0, we can add the auth decorators with the SPEC_DECORATORS
or DOCS_DECORATORS
configuration.
See more with: https://apiflask.com/openapi/#protect-openapi-endpoints
Upvotes: 2