Skip to content

Mask registered secrets at any nesting depth - #73793

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:mask-secrets-at-any-depth
Oct 19, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:mask-secrets-at-any-depth

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026

Copy link
Copy Markdown
Member

Pattern-based masking of registered secrets stopped at max_depth: a string nested deeper than that was returned without the replacer being applied, while key-name masking already worked at any depth. The replacer now applies to string leaves wherever they sit; max_depth still bounds the fail-closed walk of a value already known to be sensitive. Updates the max_depth test cases that asserted the old behaviour and adds a case for a secret embedded in a longer string.

🤖 Generated with Claude Code

Pattern-based masking of registered secrets stopped at max_depth: a
string nested deeper than that was returned without the replacer being
applied, while key-name masking already worked at any depth. Apply the
replacer to string leaves wherever they sit. max_depth still bounds the
fail-closed walk of a value already known to be sensitive.

Generated-by: Claude Opus 5
Generated-by: Claude Opus 5
@potiuk
potiuk requested a review from ephraimbuddy October 13, 2026 14:27
@potiuk potiuk added the backport-to-v3-4-test Backport to v3-4-test label Oct 16, 2026
@potiuk potiuk added this to the Airflow 3.4.0 milestone Oct 16, 2026
@potiuk

potiuk commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@amoghrajesh Could you take a look at this when you have a moment? It's targeted at 3.4.0 and needs a review to make the cut on 2026-10-19. CI is green.

@vatsrahul1001 vatsrahul1001 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Only string leaves were bounded by max_depth; the dict and iterable branches were already unbounded, so removing the check does not change the recursion behavior, and _redact_all keeps its fail-closed bound.

@potiuk
potiuk merged commit bfa2390 into apache:main Oct 19, 2026
77 checks passed
@potiuk
potiuk deleted the mask-secrets-at-any-depth branch October 19, 2026 14:56
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

potiuk added a commit that referenced this pull request Oct 19, 2026
…5112)

* Mask registered secrets at any nesting depth

Pattern-based masking of registered secrets stopped at max_depth: a
string nested deeper than that was returned without the replacer being
applied, while key-name masking already worked at any depth. Apply the
replacer to string leaves wherever they sit. max_depth still bounds the
fail-closed walk of a value already known to be sensitive.

Generated-by: Claude Opus 5

* Add newsfragment
(cherry picked from commit bfa2390)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…5112)

* Mask registered secrets at any nesting depth

Pattern-based masking of registered secrets stopped at max_depth: a
string nested deeper than that was returned without the replacer being
applied, while key-name masking already worked at any depth. Apply the
replacer to string leaves wherever they sit. max_depth still bounds the
fail-closed walk of a value already known to be sensitive.

Generated-by: Claude Opus 5

* Add newsfragment
(cherry picked from commit bfa2390)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants