flask_decorator
flask_decorator
Flask decorator for protecting routes. Tries Bearer token, API key, and Basic Auth
in order. Returns a 401 response if all methods fail.
Parameters
f
The Flask view function to protect.
Returns
Callable — The wrapped function that checks authentication before calling the
original view.
Example
The Flask decorator is used by the
mcp-gateway service.
For agent-based applications, use the FastAPI dependency instead.