Repository navigation
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
Eason09053360
left a comment
There was a problem hiding this comment.
Thanks for the fix! One inline question
| select(DagModel.dag_id).where( | ||
| DagModel.relative_fileloc == dag_model.relative_fileloc, | ||
| DagModel.bundle_name == dag_model.bundle_name, | ||
| DagModel.is_stale.in_([False, dag_model.is_stale]), |
There was a problem hiding this comment.
Should stale siblings still count for older versions (?version_number=)? An older version's source can still define the now-stale sibling, which main redacts but this now returns in full.
There was a problem hiding this comment.
Thanks for catching this. The follow-up compares the selected DagVersion with the latest one. When the selected version is older, stale co-located Dags stay in the file authorization check because the stored source may still define them. An omitted version or an explicitly selected latest version keeps the active Dag behavior: stale siblings are excluded when the requested Dag is active. The requested Dag ID remains in the authorization set in every case.
DagCode has no immutable per-version list of co-located Dag IDs, so this change restores the conservative check for the historical case without claiming to reconstruct every historical file membership.
Drafted-by: Codex (GPT-6) (no human review before posting)
Stored Dag source can still contain a sibling that is stale now. Filtering it solely by current Dag state exposes code to callers who cannot read that sibling.
When a stale Dag shares a source file and bundle with an active Dag, the source endpoint can redact code even when the caller can read every active Dag in that file.
Update the per-file authorization check to:
Make the existing co-located test fixture explicitly active and add a parametrized regression test for both requested-Dag states. This follows the security boundary raised during review of #73292.
Tests
test_dag_sources.pypass.git diff --check, and applicable manual prek hooks pass.generate-openapi-specandmypy-airflow-coreprek hooks cannot complete locally because Docker and the C compiler/Kerberos headers are unavailable. GitHub CI is pending.Fixes #73284
Was generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-6) following the guidelines