jedcunningham commented on code in PR #45009:
URL: https://github.com/apache/airflow/pull/45009#discussion_r1891057668


##########
providers/src/airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -166,13 +169,36 @@ def get_cli_commands() -> list[CLICommand]:
             commands.append(GroupCommand(name="fab-db", help="Manage FAB", 
subcommands=DB_COMMANDS))
         return commands
 
+    def get_fastapi_app(self) -> FastAPI | None:
+        flask_blueprint = self.get_api_endpoints()
+
+        if not flask_blueprint:
+            return None
+
+        flask_app = create_app()
+        flask_app.register_blueprint(flask_blueprint)
+
+        app = FastAPI(
+            title="FAB auth manager API",
+            description=(
+                "This is FAB auth manager API. This API is only available if 
the auth manager used in "
+                "the Airflow environment is FAB auth manager. "
+                "This API provides endpoints to manager users and permissions 
managed by the FAB auth "
+                "manager."
+            ),
+        )
+        app.mount("/", WSGIMiddleware(flask_app))
+
+        return app
+
     def get_api_endpoints(self) -> None | Blueprint:

Review Comment:
   With "gone", you dropped the "everything but the stuff for auth/plugins" 
before it :) I mean while we support the FAB auth manager or backcompat for 
plugins, vs when we can completely remove all traces of flask/fab.
   
   I think this would be worth moving to fastapi now, since it's something 
we've added ourselves and not something we get from FAB directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to