vincbeck commented on code in PR #47043:
URL: https://github.com/apache/airflow/pull/47043#discussion_r1973777626


##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -457,14 +459,17 @@ def register_views(self) -> None:
         """Register views specific to the auth manager."""
 
     @staticmethod
-    def _get_token_signer():
+    def _get_token_signer(expiration_time_in_seconds: int = 0) -> JWTSigner:

Review Comment:
   ```suggestion
       def _get_token_signer(expiration_time_in_seconds: int = 
conf.getint("api", "auth_jwt_expiration_time")) -> JWTSigner:
   ```



##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -457,14 +459,17 @@ def register_views(self) -> None:
         """Register views specific to the auth manager."""
 
     @staticmethod
-    def _get_token_signer():
+    def _get_token_signer(expiration_time_in_seconds: int = 0) -> JWTSigner:
         """
         Return the signer used to sign JWT token.
 
         :meta private:
         """
+        if expiration_time_in_seconds == 0:
+            expiration_time_in_seconds = conf.getint("api", 
"auth_jwt_expiration_time")
+

Review Comment:
   ```suggestion
   ```



##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -114,9 +114,11 @@ def get_user_from_token(self, token: str) -> BaseUser:
             log.error("JWT token is not valid")
             raise e
 
-    def get_jwt_token(self, user: T) -> str:
+    def get_jwt_token(self, user: T, expiration_time_in_seconds: int = 0) -> 
str:

Review Comment:
   ```suggestion
       def get_jwt_token(self, user: T, expiration_time_in_seconds: int = 
conf.getint("api", "auth_jwt_expiration_time")) -> str:
   ```



##########
providers/fab/src/airflow/providers/fab/auth_manager/security_manager/override.py:
##########
@@ -63,7 +63,10 @@
 )
 from flask_appbuilder.views import expose
 from flask_babel import lazy_gettext
-from flask_jwt_extended import JWTManager, current_user as current_user_jwt
+from flask_jwt_extended import (
+    JWTManager,
+    current_user as current_user_jwt,
+)

Review Comment:
   Not needed?



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