Fix: add RUN, HITL_DETAIL, TASK_INSTANCE entities to /dags endpoint as it returns nested entities in response#64822
Conversation
ecb6e6e to
3208ff0
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Looking good. We might need a significant newsfragment just to mention this. Just a disclaimer for people to double check their users permissions check or they might have unintended forbidden errors.
Thanks! I will look into how to add a newsfragment for this change. |
3208ff0 to
8f39310
Compare
259a250 to
363948c
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nit I think we need to make the newsfragment clearer.
363948c to
d9f9403
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds missing authorization requirements for nested entities returned by the UI /dags endpoint, ensuring access control covers DAG Runs, HITL Details, and Task Instances included in the response.
Changes:
- Require
DagAccessEntity.RUN,DagAccessEntity.HITL_DETAIL, andDagAccessEntity.TASK_INSTANCEpermissions onGET /dags. - Add a unit test asserting
403when any required sub-entity permission is missing. - Add a significant newsfragment documenting the permission change and migration guidance.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py | Adds additional requires_access_dag dependencies for nested entities returned by /dags. |
| airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py | Adds a parametrized test to verify missing entity permissions cause a 403. |
| airflow-core/newsfragments/64822.significant.rst | Documents the breaking permission change for consumers/custom roles. |
|
Thanks, I will check and resolve the copilot comments by this week. |
…s endpoint as it returns nested entities in response (#64822) * add RUN, HITL_DETAIL, TASK_INSTANCE entities to /dags endpoint as it returns nested entities in response * add newsfragment for significant change to /dags endpoint * update newsfragment message to be more clear (cherry picked from commit fed4921) Co-authored-by: Kevin Yang <85313829+sjyangkevin@users.noreply.github.com>
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…s endpoint as it returns nested entities in response (#64822) * add RUN, HITL_DETAIL, TASK_INSTANCE entities to /dags endpoint as it returns nested entities in response * add newsfragment for significant change to /dags endpoint * update newsfragment message to be more clear (cherry picked from commit fed4921) Co-authored-by: Kevin Yang <85313829+sjyangkevin@users.noreply.github.com>
The /dags endpoint returns nested entities include
RUN, andHITLDetailincludesTaskInstanceResponse. Add related access entity to govern the endpoint.Was generative AI tooling used to co-author this PR?
Generated-by: [Claude Code - Sonnet 4.6] following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.