vincbeck commented on code in PR #45009:
URL: https://github.com/apache/airflow/pull/45009#discussion_r1890507608
##########
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:
What is the difference between gone and completely gone? 😄 I actually was
wrong, the method `get_api_endpoints` allow the auth manager to extend the
Airflow 2 Rest API, so whenever the Airflow 2 Rest API is removed, it will be
safe to remove this method as well from the interface (and then making private
in the fab auth manager).
--
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]