Skip to content

[v3-3-test] Authorize Dag reparse against the file's Dags, not the query-string dag_id#70115

Merged
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-69471
Jul 20, 2026
Merged

[v3-3-test] Authorize Dag reparse against the file's Dags, not the query-string dag_id#70115
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-69471

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Backport of #69471 to v3-3-test.

Cherry-picked from c5faeb1.

Clean cherry-pick, no conflicts.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

…ag_id (apache#69471)

* Authorize Dag reparse against the file's Dags, not the query-string dag_id

The PUT /parseDagFile/{file_token} endpoint authorized the caller through a route dependency that, with no dag_id path parameter, resolves the target from the query string, which is decoupled from the Dag file the signed file_token actually resolves to.

Add a requires_access_dag_from_file_token dependency that decodes the token, resolves the Dags defined in that file, and authorizes the caller against exactly those Dags, so authorization always matches the Dag being reparsed regardless of any request parameter.

* Update airflow-core/src/airflow/api_fastapi/core_api/security.py

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>

* Fix CI

---------

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
(cherry picked from commit c5faeb1)
@pierrejeambrun

Copy link
Copy Markdown
Member Author

unrelated CI failure, merging.

@pierrejeambrun
pierrejeambrun merged commit c91b640 into apache:v3-3-test Jul 20, 2026
67 of 69 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-69471 branch July 20, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:dev-tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant