pierrejeambrun commented on code in PR #70783:
URL: https://github.com/apache/airflow/pull/70783#discussion_r3767854634


##########
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 method is supposed to be overrideable in sub classes to swap out the 
base behaviour JWTRefreshMiddleware for some other middleware, see
   
   I don't understand how this answer the question above. Couldn't the local 
import be moved at the top of the files similarly to other imports?



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