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


##########
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:
   I was thinking of making it private method whenever the Airflow 2 legacy UI 
is gone. We still need this one as long as we use the Airflow 2 legacy UI



-- 
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