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


##########
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:
   Here, basically nothing. The only change is I now cast the dict to be 
`IsAuthorizedRequest`. Without this casting, the IDE shows a warning from mypy 
saying that types do not match



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