gaurav0107 commented on code in PR #65685:
URL: https://github.com/apache/airflow/pull/65685#discussion_r3131599585


##########
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:
##########
@@ -158,6 +158,18 @@ async def get_user_from_token(self, token: str) -> 
BaseUser:
             log.error("Couldn't deserialize user from token, JWT token is not 
valid: %s", e)
             raise InvalidTokenError(str(e))
 
+    def get_fastapi_middlewares(self) -> list[tuple[type, dict[str, Any]]]:
+        """
+        Return middlewares the auth manager wants registered on the main 
FastAPI app.
+
+        Each entry is a ``(middleware_class, kwargs)`` tuple and is registered 
via
+        ``app.add_middleware`` by the API server. Auth managers that need to 
intercept or
+        augment incoming requests (for example, the FAB auth manager attaching 
an
+        anonymous user to unauthenticated requests when ``[fab] 
auth_role_public`` is
+        configured) should override this method.

Review Comment:
   Good point — rephrased the docstring to describe the behavior generically 
("attaching an anonymous user to unauthenticated requests when public access is 
configured") instead of naming FAB. Pushed in 7927edf.



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