airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Add option in auth manager interface to define FastAPI api

Open vincbeck opened this issue 1 year ago • 0 comments

Resolves #44882 and #44847.

Today there is an option to extend the Flask Rest API in the auth manager interface. That allows, for instance, the FAB auth manager to extend the Rest API and define users, roles and permissions related APIs.

In Airflow 3, we are moving away from Flask and use FastApi as engine for APIs. As such, the auth manager interface should have an option to extend this API using FastAPI (instead of Flask).

In FAB auth manager, instead of converting all the APIs defined with Flask to FastAPI, we use WSGIMiddleware to embed a minimal Flask application that host the APIs.

With this PR: GET http://localhost:29091/auth/auth/fab/v1/roles return the list of roles. The duplicate auth/auth in the API path will be removed when the legacy Airflow 2 is gone.


^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

vincbeck avatar Dec 17 '24 20:12 vincbeck