Pass the Dag bundle's team to secrets backends during Dag parsing - #72139
Open
taehwoi wants to merge 1 commit into
Open
Pass the Dag bundle's team to secrets backends during Dag parsing#72139taehwoi wants to merge 1 commit into
taehwoi wants to merge 1 commit into
Conversation
taehwoi
requested review from
amoghrajesh,
ashb,
ephraimbuddy,
jedcunningham and
kaxil
as code owners
August 27, 2026 09:14
|
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
|
taehwoi
force-pushed
the
dag-parsing-team-scoped-secrets
branch
3 times, most recently
from
August 27, 2026 09:29
62c8669 to
94d3571
Compare
Secrets backends receive team_name during task execution (resolved from the task instance the token identifies), but at parse time it was always None, so team-scoped connections and variables did not resolve in top-level Dag code. The Dag processor now gives each parsing process an in-process API client whose requests carry the bundle name. The in-process app puts it in the token's new bundle_name claim and get_team_name_dep resolves the team from DagBundleModel, the same way it resolves it from a task instance. Only the in-process app reads the header; the API server takes identity from the signed token and ignores it. closes: apache#70495
taehwoi
force-pushed
the
dag-parsing-team-scoped-secrets
branch
from
August 27, 2026 09:43
94d3571 to
d04fcec
Compare
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.
Secrets backends receive
team_nameduring task execution, but during Dag file parsing it was alwaysNone, so team-scoped connections and variables did not resolve in top-level Dag code (see #65530).What changes:
airflow-dag-bundle-nameheader).InProcessExecutionAPIreads that header into a newTIClaims.bundle_nameclaim.get_team_name_depresolves the team fromDagBundleModelwhen the claim is set, and from the task instance otherwise, so variables and connections routes need no changes.Design note, feedback welcome: the in-process app is shared by every parsing process in the manager, so the bundle identity has to travel with each request. A header read only by the in-process auth override was the smallest carrier I found. Alternatives considered: a query parameter honored by the real server (spoofable from a task token), resolving secrets directly in the manager (bypasses the execution API), a signed token minted by the Dag processor (needs the JWT key there). If another carrier fits the AIP-92 direction better, I am glad to switch.
Not included: the triggerer has the same gap (
TriggerRunnerSupervisor.team_nameis known but not passed); it can reuse this mechanism through itsmake_clientseam in a follow-up.closes: #70495
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Fable 5) following the guidelines