Skip to content

Walk nested lists/tuples/sets in secrets masker key-name redaction#68422

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:redact-walk-nested-iterables-for-key-name-masking
Open

Walk nested lists/tuples/sets in secrets masker key-name redaction#68422
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:redact-walk-nested-iterables-for-key-name-masking

Conversation

@potiuk

@potiuk potiuk commented Jun 12, 2026

Copy link
Copy Markdown
Member

The secrets masker walks dicts unconditionally for key-name-based redaction, so a sensitive key nested in dicts is masked at any depth. Lists, tuples, and sets, however, were only walked below the recursion-depth cutoff — so a value carrying a sensitive key wrapped in an iterable beyond the cutoff was returned without key-name redaction.

This walks nested lists/tuples/sets unconditionally too, mirroring the dict handling, keeping the depth cutoff only for pattern-based string masking. Adds regression tests for sensitive keys wrapped in lists and tuples past MAX_RECURSION_DEPTH.

Tests

  • Extended test_redact_sensitive_key_past_max_depth with list- and tuple-wrapped cases past the cutoff
  • Existing test_redact_max_depth (pattern-masking depth bound) unchanged
  • Full test_secrets_masker.py suite green
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Opus 4.8 (1M context)

Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

The secrets masker walks dicts unconditionally for key-name-based
redaction, so a sensitive key nested in dicts is masked at any depth.
Lists, tuples, and sets were only walked below the recursion-depth
cutoff, so a value carrying a sensitive key wrapped in an iterable
beyond the cutoff was returned without key-name redaction.

Walk nested lists/tuples/sets unconditionally too, mirroring the dict
handling, keeping the depth cutoff only for pattern-based string
masking. Add regression tests for sensitive keys wrapped in lists and
tuples past MAX_RECURSION_DEPTH.

Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
@potiuk potiuk requested review from amoghrajesh and ashb as code owners June 12, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant