Repository navigation
Require Dag edit to delete asset queued events - #71736
Merged
Merged
Conversation
The three asset queued-events DELETE endpoints authorized the Dag axis with requires_access_dag(method="GET") — a read-level check — while deleting rows from AssetDagRunQueue, which cancels a Dag's pending asset-triggered scheduling. Every other Dag-scheduling mutation in the API requires Dag edit: Dag run clear, patch and delete use method="PUT"/"DELETE" with access_entity=RUN, and task-instance state changes use method="PUT". These three deletes were the only Dag-scheduling-state writes gated on read, so a caller holding delete on the global "Assets" resource plus only read on a Dag could suppress that Dag's asset-triggered runs. Change the Dag-axis gate on the three routes to method="PUT". The paired requires_access_asset(method="DELETE") and the ReadableDagsFilterDep row filter are unchanged; only the Dag axis moves from read to edit. The generated REST API permission reference is updated to match. The GET queued-events routes keep method="GET" — reading queued events is a read. Added a structural test asserting the Dag-axis method each queued-events route carries, so the read/write asymmetry cannot silently return. "dependant" is added to the spelling wordlist: it is FastAPI's own attribute name on a route. Generated-by: Claude Opus 5 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
potiuk
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
August 17, 2026 21:01
vincbeck
reviewed
Aug 17, 2026
vincbeck
approved these changes
Aug 18, 2026
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
potiuk
added a commit
that referenced
this pull request
Aug 19, 2026
…71828) The three asset queued-events DELETE endpoints authorized the Dag axis with requires_access_dag(method="GET") — a read-level check — while deleting rows from AssetDagRunQueue, which cancels a Dag's pending asset-triggered scheduling. Every other Dag-scheduling mutation in the API requires Dag edit: Dag run clear, patch and delete use method="PUT"/"DELETE" with access_entity=RUN, and task-instance state changes use method="PUT". These three deletes were the only Dag-scheduling-state writes gated on read, so a caller holding delete on the global "Assets" resource plus only read on a Dag could suppress that Dag's asset-triggered runs. Change the Dag-axis gate on the three routes to method="PUT". The paired requires_access_asset(method="DELETE") and the ReadableDagsFilterDep row filter are unchanged; only the Dag axis moves from read to edit. The generated REST API permission reference is updated to match. The GET queued-events routes keep method="GET" — reading queued events is a read. Added a structural test asserting the Dag-axis method each queued-events route carries, so the read/write asymmetry cannot silently return. "dependant" is added to the spelling wordlist: it is FastAPI's own attribute name on a route. (cherry picked from commit 0414544) Generated-by: Claude Opus 5 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <[email protected]>
vatsrahul1001
pushed a commit
that referenced
this pull request
Sep 7, 2026
…71828) The three asset queued-events DELETE endpoints authorized the Dag axis with requires_access_dag(method="GET") — a read-level check — while deleting rows from AssetDagRunQueue, which cancels a Dag's pending asset-triggered scheduling. Every other Dag-scheduling mutation in the API requires Dag edit: Dag run clear, patch and delete use method="PUT"/"DELETE" with access_entity=RUN, and task-instance state changes use method="PUT". These three deletes were the only Dag-scheduling-state writes gated on read, so a caller holding delete on the global "Assets" resource plus only read on a Dag could suppress that Dag's asset-triggered runs. Change the Dag-axis gate on the three routes to method="PUT". The paired requires_access_asset(method="DELETE") and the ReadableDagsFilterDep row filter are unchanged; only the Dag axis moves from read to edit. The generated REST API permission reference is updated to match. The GET queued-events routes keep method="GET" — reading queued events is a read. Added a structural test asserting the Dag-axis method each queued-events route carries, so the read/write asymmetry cannot silently return. "dependant" is added to the spelling wordlist: it is FastAPI's own attribute name on a route. (cherry picked from commit 0414544) Generated-by: Claude Opus 5 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three asset queued-events
DELETEendpoints authorize the Dag axis withrequires_access_dag(method="GET")— a read-level check — while deleting rows fromAssetDagRunQueue, which cancels a Dag's pending asset-triggered scheduling.Every other Dag-scheduling mutation in the API requires Dag edit:
method="PUT"/"DELETE"withaccess_entity=RUNmethod="PUT"These three deletes were the only Dag-scheduling-state writes gated on read. A caller holding
can_deleteon the globalAssetsresource plus onlycan_readon a Dag could therefore suppress that Dag's asset-triggered runs.Change
The Dag-axis gate on the three routes moves to
method="PUT". The pairedrequires_access_asset(method="DELETE")and theReadableDagsFilterDeprow filter are unchanged — only the Dag axis moves from read to edit.The
GETqueued-events routes keepmethod="GET"; reading queued events is a read.The generated REST API permission reference picked the change up automatically:
* - ``DELETE`` - ``/api/v2/dags/{dag_id}/assets/queuedEvents`` - ``DAG`` - - ``GET`` + - ``PUT``Compatibility
This is a tightening, so a caller who previously succeeded with only Dag read on these three endpoints will now get a 403. That is the intent, but it is worth a second opinion on whether it needs a release-note callout beyond the permission-reference diff.
Testing
Added
TestQueuedEventsDagAxisAuthorization, which introspects the registered routes and asserts themethodeachrequires_access_dagwas built with —PUTon the three deletes,GETon the two reads. Verified it is not vacuous: reverting the source change makes exactly the three delete assertions fail while the two read assertions still pass.All 185 tests in
test_assets.pypass.dependantis added todocs/spelling_wordlist.txt— it is FastAPI's own attribute name on a route object, which codespell otherwise flags.Generated-by: Claude Opus 5 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions