Refuse separator-bearing env secret ids only in multi-team mode - #71136
Closed
potiuk wants to merge 1 commit into
Closed
Refuse separator-bearing env secret ids only in multi-team mode#71136potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
The environment variables backend refuses any connection or variable id carrying the team namespace separator, because such an id cannot be attributed to a team unambiguously. That refusal fires unconditionally, including in deployments that never enabled multi-team mode, where an ordinary id that happens to contain `___` is silently reported as missing. No team scoped secret can be read while multi-team is off -- the lookups are only ever given a team name in that mode -- so the id has a single meaning there and nothing needs refusing. This is the core half of the same regression fixed for the AWS, Key Vault, Google Secret Manager and Lockbox backends in apache#71078.
potiuk
requested review from
amoghrajesh,
vatsrahul1001 and
vincbeck
and removed request for
ashb and
dstandish
August 5, 2026 03:32
Member
Author
|
Closing in favour of #71079 |
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.
Another follow-up after @amoghrajesh's #71078, which fixed this same regression in the AWS, Key Vault, Google Secret Manager and Lockbox secrets backends. The core
EnvironmentVariablesBackendcarries it too, and was not covered there — cc @vatsrahul1001 @amoghrajesh.The backend refuses any connection or variable id carrying the team namespace separator, because such an id cannot be attributed to a team unambiguously — a team name may itself contain the separator, so
_a___b___creads as teamawith idb___cjust as well as teama___bwith idc.That refusal fires unconditionally, including in deployments that never enabled multi-team mode. There, an ordinary connection or variable id that happens to contain
___is silently reported as missing — no exception, and nothing distinguishes it from a secret that was never set.No team scoped secret can be read while multi-team is off: the lookups are only ever handed a
team_namein that mode. So the id has a single meaning there and nothing needs refusing. Same gate as #71078, applied at the same place in the logic.What this changes for the tests
The existing team-scoping tests all assert the refusal, so they now run with multi-team enabled. Two of them (
test_connection_env_var_do_not_access_team_specificandtest_variable_env_var_do_not_access_team_specific) would otherwise fail, becauseAIRFLOW_CONN__TEAM___TEST_MYSQLlegitimately resolves as an ordinary connection named_team___test_mysqlonce multi-team is off — that is the intended trade, and the same one #71078 makes on the provider side.Test plan
TestEnvironmentVariablesBackendWithoutMultiTeam— verified against unmodified code: it fails withassert None == 'team-agnostic-value', the reported symptom exactlytest_secrets.py,test_secrets_environment_variables.py,test_secrets_backends.py— 72 passedairflow-core/tests/unit/always— 2008 passed; the one failure (example_mysql_to_gcs.py) is a missingmysqlclienton the host and reproduces on unmodifiedmainruff/ruff format/ static checks cleanNo newsfragment: #70736 is milestoned 3.3.1 and unreleased, so the regression never reached users.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines