pierrejeambrun commented on code in PR #62046:
URL: https://github.com/apache/airflow/pull/62046#discussion_r2817436098


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dependencies.py:
##########
@@ -48,10 +48,14 @@
 )
 def get_dependencies(
     session: SessionDep,
+    user: GetUserDep,
+    auth_manager: AuthManagerDep,
     node_id: str | None = None,
     dependency_type: Literal["scheduling", "data"] = "scheduling",
 ) -> BaseGraphResponse:
     """Dependencies graph."""
+    readable_dag_ids = auth_manager.get_authorized_dag_ids(method="GET", 
user=user)

Review Comment:
   Can you use the dependency `ReadableDagsFilterDep` instead.



##########
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dependencies.py:
##########
@@ -258,7 +258,7 @@ def test_with_node_id_filter_with_asset(
             (asset1_id, expected_primary_component_response),
             (asset2_id, expected_secondary_component_response),
         ):
-            with assert_queries_count(5):
+            with assert_queries_count(6):

Review Comment:
   We need an extra test, where we mock the 
`auth_manager.get_authorized_dag_ids` to return only some dag ids and verify 
that the response doesn't contain unwanted nodes or edges.



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