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


##########
providers/amazon/tests/unit/amazon/aws/auth_manager/test_aws_auth_manager.py:
##########
@@ -944,9 +944,17 @@ def test_filter_authorized_assets_empty(self, 
auth_manager, test_user):
 
         assert auth_manager.filter_authorized_assets(assets=[], 
user=test_user, method="GET") == set()
 
-    def test_get_url_login(self, auth_manager):
-        result = auth_manager.get_url_login()
-        assert result == f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login"
+    @pytest.mark.parametrize(
+        ("kwargs", "expected"),
+        [
+            ({}, f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login"),
+            ({"next_url": "/dags/my_dag"}, 
f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login?next=%2Fdags%2Fmy_dag"),
+            ({"next_url": None}, f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login"),

Review Comment:
   nit: this case already passes without your change, no need to test it
   
   ```suggestion
   ```



##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py:
##########
@@ -538,7 +538,10 @@ def filter_authorized_variables(
         }
 
     def get_url_login(self, **kwargs) -> str:
-        return urljoin(self.apiserver_endpoint, 
f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login")
+        login_url = urljoin(self.apiserver_endpoint, 
f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/login")
+        if next_url := kwargs.get("next_url"):

Review Comment:
   Where is this called with `next_url` when the AWS auth manager is 
configured? The core `/auth/login` route calls `get_url_login()` without 
arguments and adds `next` itself, so I don't think this changes anything today.



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