jason810496 commented on code in PR #48498:
URL: https://github.com/apache/airflow/pull/48498#discussion_r2018883339


##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/services/login.py:
##########
@@ -29,17 +29,15 @@
 class SimpleAuthManagerLogin:
     """Service for login."""
 
-    @classmethod
+    @staticmethod
     def create_token(
-        cls, body: LoginBody, expiration_time_in_sec: int = 
conf.getint("api_auth", "jwt_expiration_time")
-    ) -> LoginResponse:
+        body: LoginBody, expiration_time_in_sec: int = conf.getint("api_auth", 
"jwt_expiration_time")
+    ) -> str:
         """
         Authenticate user with given configuration.
 
         :param body: LoginBody should include username and password
         :param expiration_time_in_sec: int expiration time in seconds
-
-        :return: LoginResponse
         """
         if not body.username or not body.password:

Review Comment:
   > We could. We then dismiss the body sent by the user?
   Sure, looks good to me. Or perhaps my concern might be a bit far-fetched — 
I'm not sure if I'm overthinking it.



##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/services/login.py:
##########
@@ -29,17 +29,15 @@
 class SimpleAuthManagerLogin:
     """Service for login."""
 
-    @classmethod
+    @staticmethod
     def create_token(
-        cls, body: LoginBody, expiration_time_in_sec: int = 
conf.getint("api_auth", "jwt_expiration_time")
-    ) -> LoginResponse:
+        body: LoginBody, expiration_time_in_sec: int = conf.getint("api_auth", 
"jwt_expiration_time")
+    ) -> str:
         """
         Authenticate user with given configuration.
 
         :param body: LoginBody should include username and password
         :param expiration_time_in_sec: int expiration time in seconds
-
-        :return: LoginResponse
         """
         if not body.username or not body.password:

Review Comment:
   > We could. We then dismiss the body sent by the user?
   
   Sure, looks good to me. Or perhaps my concern might be a bit far-fetched — 
I'm not sure if I'm overthinking it.



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