o-nikolas commented on code in PR #55307:
URL: https://github.com/apache/airflow/pull/55307#discussion_r2326124827


##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py:
##########
@@ -244,25 +247,93 @@ def _has_access_to_menu_item(request: 
IsAuthorizedRequest):
 
         return [menu_item for menu_item in menu_items if 
_has_access_to_menu_item(requests[menu_item.value])]
 
+    def batch_is_authorized_connection(
+        self,
+        requests: Sequence[IsAuthorizedConnectionRequest],
+        *,
+        user: AwsAuthManagerUser,
+    ) -> bool:
+        facade_requests: Sequence[IsAuthorizedRequest] = [
+            cast(
+                "IsAuthorizedRequest",
+                {
+                    "method": request["method"],
+                    "entity_type": AvpEntities.CONNECTION,
+                    "entity_id": cast("ConnectionDetails", 
request["details"]).conn_id
+                    if request.get("details")
+                    else None,
+                },
+            )
+            for request in requests
+        ]
+        return self.avp_facade.batch_is_authorized(requests=facade_requests, 
user=user)
+
     def batch_is_authorized_dag(
         self,
         requests: Sequence[IsAuthorizedDagRequest],
         *,
         user: AwsAuthManagerUser,
     ) -> bool:
         facade_requests: Sequence[IsAuthorizedRequest] = [
-            {
-                "method": request["method"],
-                "entity_type": AvpEntities.DAG,
-                "entity_id": cast("DagDetails", request["details"]).id if 
request.get("details") else None,
-                "context": {
-                    "dag_entity": {
-                        "string": cast("DagAccessEntity", 
request["access_entity"]).value,
-                    },
-                }
-                if request.get("access_entity")
-                else None,
-            }
+            cast(

Review Comment:
   It's hard for me to grok the code below for batch_is_authorized_dag. What is 
really changing here?



##########
providers/amazon/tests/unit/amazon/aws/auth_manager/test_aws_auth_manager.py:
##########
@@ -439,6 +439,40 @@ def test_filter_authorized_menu_items(self, auth_manager):
         )

Review Comment:
   No tests for the changes to the dag batch method?



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to