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


##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -757,8 +757,12 @@ async def _collect_teams_to_check(
     if method != "POST":
         teams.add(get_existing_team(resource_id) if resource_id else None)
     if method in ("POST", "PUT"):
-        with suppress(JSONDecodeError):
+        try:
             raw = (await request.json()).get("team_name")
+        except JSONDecodeError:
+            # Fail closed: ensure auth callback still runs when team can't be 
determined.
+            teams.add(None)

Review Comment:
   Would it be better to directly raise `HTTP_400_BAD_REQUEST` if encounter 
`JSONDecodeError` (early return to avoid the further bypass)



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