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


##########
airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py:
##########
@@ -180,7 +180,17 @@ def get_fastapi_middlewares(self) -> 
list[tuple[_MiddlewareFactory[Any], dict[st
         unauthenticated requests when public access is configured) should 
override this
         method.
         """
-        return []
+        return [self._get_jwt_refresh_middleware()]
+
+    def _get_jwt_refresh_middleware(self) -> tuple[_MiddlewareFactory[Any], 
dict[str, Any]]:
+        """
+        Return the JWTRefreshMiddleware to refresh the Airflow JWT token.
+
+        :important: The JWTRefreshMiddleware should be included in 
get_fastapi_middlewares()
+        """
+        from airflow.api_fastapi.auth.middlewares.refresh_token import 
JWTRefreshMiddleware

Review Comment:
   This would work, but the 
`airflow.api_fastapi.auth.middlewares.refresh_token` import is circular



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