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


##########
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:
   Should this be moving (or maybe copied in the short term?) into 
`get_fastapi_app` too?



##########
airflow/api_connexion/security.py:
##########
@@ -32,8 +32,8 @@
     PoolDetails,
     VariableDetails,
 )
+from airflow.providers.fab.www.extensions.init_auth_manager import 
get_auth_manager

Review Comment:
   I don't think we should be moving `get_auth_manager` into a provider, that 
feels like something that should stay in core. Right?



##########
airflow/auth/managers/base_auth_manager.py:
##########


Review Comment:
   Probably worth leaving a comment that BaseAuthManager will eventually stop 
accepting an `AirflowAppBuilder` in init`?



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