Skip to content

[v3-3-test] Hide team scoped values of options registered as sensitive (#70755) - #71099

Merged
vatsrahul1001 merged 1 commit into
v3-3-testfrom
backport-d41ac7b-v3-3-test
Aug 4, 2026
Merged

[v3-3-test] Hide team scoped values of options registered as sensitive (#70755)#71099
vatsrahul1001 merged 1 commit into
v3-3-testfrom
backport-d41ac7b-v3-3-test

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  • Hide team scoped values of options registered as sensitive

Options are registered as sensitive under their base section, but a team scoped
override lives in a [<team>=<section>] config file section, or in an
AIRFLOW__<TEAM>___<SECTION>__<KEY> environment variable. Every sensitivity
decision was a direct membership test against the registered base pairs, and the
masking pass iterated those pairs and looked each section up verbatim, so a team
scoped section was never visited and its value was returned in clear.

Resolve the team scoped spelling back to the base option before deciding whether
a value is sensitive. team_section_name now builds the config file section name
at both construction sites so the two representations cannot drift,
base_section_name recovers the base section from it, and is_sensitive_option
tests a pair directly, then via the base section, then via the tail an
environment variable contributes -- so it can only ever recognise more options as
sensitive, never fewer.

The team name is not parsed out of an environment variable name, because a team
name may contain underscores; the name is matched against the tail each
registered option contributes instead. The config file section name is split on
the last separator, so the base section is recovered even for a team name that
contains the separator itself.

Four call sites use the predicate: the masking pass, the environment collection,
write, and the single option config route, which does not go through as_dict
and so needed its own change.

Team scoped _cmd and _secret entries are hidden in place rather than resolved
into their value, because resolving them is not supported for a team.

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

  • Add newsfragment for the team scoped sensitive option masking change

  • Keep one copy of the team scoped masking rationale, and record the untouched gap

The per-key secrets-backend options are matched by literal section name and stay
unaware of a team scoped spelling. Nothing leaks while the secrets backend itself
is not team aware, so it is recorded rather than fixed here.

  • Update shared/configuration/tests/configuration/test_parser.py

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

  • Update airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_config.py

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


(cherry picked from commit d41ac7b)

Co-authored-by: Jarek Potiuk jarek@potiuk.com
Co-authored-by: Amogh Desai amoghrajesh1999@gmail.com

#70755)

* Hide team scoped values of options registered as sensitive

Options are registered as sensitive under their base section, but a team scoped
override lives in a `[<team>=<section>]` config file section, or in an
`AIRFLOW__<TEAM>___<SECTION>__<KEY>` environment variable. Every sensitivity
decision was a direct membership test against the registered base pairs, and the
masking pass iterated those pairs and looked each section up verbatim, so a team
scoped section was never visited and its value was returned in clear.

Resolve the team scoped spelling back to the base option before deciding whether
a value is sensitive. `team_section_name` now builds the config file section name
at both construction sites so the two representations cannot drift,
`base_section_name` recovers the base section from it, and `is_sensitive_option`
tests a pair directly, then via the base section, then via the tail an
environment variable contributes -- so it can only ever recognise more options as
sensitive, never fewer.

The team name is not parsed out of an environment variable name, because a team
name may contain underscores; the name is matched against the tail each
registered option contributes instead. The config file section name is split on
the last separator, so the base section is recovered even for a team name that
contains the separator itself.

Four call sites use the predicate: the masking pass, the environment collection,
`write`, and the single option config route, which does not go through `as_dict`
and so needed its own change.

Team scoped `_cmd` and `_secret` entries are hidden in place rather than resolved
into their value, because resolving them is not supported for a team.

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

* Add newsfragment for the team scoped sensitive option masking change

* Keep one copy of the team scoped masking rationale, and record the untouched gap

The per-key secrets-backend options are matched by literal section name and stay
unaware of a team scoped spelling. Nothing leaks while the secrets backend itself
is not team aware, so it is recorded rather than fixed here.

* Update shared/configuration/tests/configuration/test_parser.py

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

* Update airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_config.py

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

---------
(cherry picked from commit d41ac7b)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Aug 4, 2026
@vatsrahul1001
vatsrahul1001 marked this pull request as ready for review August 4, 2026 14:01
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.1 milestone Aug 4, 2026
@vatsrahul1001 vatsrahul1001 added type:misc/internal Changelog: Misc changes that should appear in change log type:bug-fix Changelog: Bug Fixes and removed type:bug-fix Changelog: Bug Fixes labels Aug 4, 2026
@vatsrahul1001
vatsrahul1001 merged commit 358062d into v3-3-test Aug 4, 2026
101 of 110 checks passed
@vatsrahul1001
vatsrahul1001 deleted the backport-d41ac7b-v3-3-test branch August 4, 2026 15:36
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
#70755) (#71099)

* Hide team scoped values of options registered as sensitive

Options are registered as sensitive under their base section, but a team scoped
override lives in a `[<team>=<section>]` config file section, or in an
`AIRFLOW__<TEAM>___<SECTION>__<KEY>` environment variable. Every sensitivity
decision was a direct membership test against the registered base pairs, and the
masking pass iterated those pairs and looked each section up verbatim, so a team
scoped section was never visited and its value was returned in clear.

Resolve the team scoped spelling back to the base option before deciding whether
a value is sensitive. `team_section_name` now builds the config file section name
at both construction sites so the two representations cannot drift,
`base_section_name` recovers the base section from it, and `is_sensitive_option`
tests a pair directly, then via the base section, then via the tail an
environment variable contributes -- so it can only ever recognise more options as
sensitive, never fewer.

The team name is not parsed out of an environment variable name, because a team
name may contain underscores; the name is matched against the tail each
registered option contributes instead. The config file section name is split on
the last separator, so the base section is recovered even for a team name that
contains the separator itself.

Four call sites use the predicate: the masking pass, the environment collection,
`write`, and the single option config route, which does not go through `as_dict`
and so needed its own change.

Team scoped `_cmd` and `_secret` entries are hidden in place rather than resolved
into their value, because resolving them is not supported for a team.

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

* Add newsfragment for the team scoped sensitive option masking change

* Keep one copy of the team scoped masking rationale, and record the untouched gap

The per-key secrets-backend options are matched by literal section name and stay
unaware of a team scoped spelling. Nothing leaks while the secrets backend itself
is not team aware, so it is recorded rather than fixed here.

* Update shared/configuration/tests/configuration/test_parser.py



* Update airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_config.py



---------
(cherry picked from commit d41ac7b)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
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 type:misc/internal Changelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants