amoghrajesh commented on code in PR #66504:
URL: https://github.com/apache/airflow/pull/66504#discussion_r3263723594


##########
airflow-core/tests/unit/api_fastapi/core_api/test_security.py:
##########
@@ -587,6 +587,37 @@ async def 
test_requires_access_connection_post_invalid_team_returns_400(
         assert exc_info.value.status_code == 400
         assert "nonexistent" in exc_info.value.detail
 
+    @pytest.mark.db_test
+    @pytest.mark.parametrize("method", ["POST", "PUT"])
+    @patch.object(Team, "get_name_if_exists")
+    @patch.object(Connection, "get_team_name")
+    @patch("airflow.api_fastapi.core_api.security.get_auth_manager")
+    async def test_requires_access_connection_body_parse_failure_fails_closed(
+        self, mock_get_auth_manager, mock_get_team_name, 
mock_get_name_if_exists, method
+    ):
+        """If the request body cannot be parsed, the auth callback must still 
run with team=None."""
+        from json import JSONDecodeError

Review Comment:
   Can we move this to top level pls?



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