stephen-bracken commented on code in PR #70783:
URL: https://github.com/apache/airflow/pull/70783#discussion_r3684481631


##########
providers/fab/tests/unit/fab/auth_manager/test_fab_auth_manager.py:
##########
@@ -328,8 +329,12 @@ def test_get_fastapi_middlewares_disabled(self, flask_app, 
auth_manager_with_app
         """No middleware is registered when public access is not configured."""
         previous = flask_app.config.get("AUTH_ROLE_PUBLIC")
         flask_app.config["AUTH_ROLE_PUBLIC"] = None
+        if hasattr(super(FabAuthManager), "get_fastapi_middlewares"):

Review Comment:
   This is to provide backwards compatibility, it can be removed in later 
versions



##########
providers/fab/src/airflow/providers/fab/auth_manager/fab_auth_manager.py:
##########
@@ -366,11 +366,18 @@ def build_public_user(self, *, session: Session = 
NEW_SESSION) -> AnonymousUser
 
     def get_fastapi_middlewares(self) -> list[tuple[_MiddlewareFactory[Any], 
dict[str, Any]]]:
         """Register the FAB public-access middleware when public access is 
configured."""
-        if not self._get_auth_role_public():
-            return []
-        from airflow.providers.fab.auth_manager.middleware import 
FabAuthRolePublicMiddleware
+        # Backwards compatible fix for 
BaseAuthManager.get_fastapi_middlewares()
+        if hasattr(super(), "get_fastapi_middlewares"):

Review Comment:
   This is to provide backwards compatibility, it can be removed in later 
versions



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