You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pulaksaha143 (via GitHub)" <gi...@apache.org> on 2026/08/16 17:18:24 UTC
[PR] Fix Secrets Masker for non-string values [airflow]
pulaksaha143 opened a new pull request, #71685:
URL: https://github.com/apache/airflow/pull/71685
Fixes #71275
**Description**
The `SecretsMasker` previously only redacted `str` scalar values. This meant that non-string scalars like `int`, `float`, `bool`, and `None` passed through in cleartext via the REST API even when their keys matched sensitive keywords (e.g. `test-password`).
This PR updates `_redact_all` to invert the type check: it now masks any value that is not explicitly traversed as a collection (`dict`, `tuple`, `set`, `list`), ensuring that numeric API keys and PINs are securely masked.
Note that `merge()` seamlessly restores the original non-string scalar without issues because it only checks if the incoming payload contains the string `"***"` before discarding it in favor of the original value.
**Testing**
* Added assertions for numeric and boolean redaction to `test_redact_all_directly`. All `airflow_shared/secrets_masker` tests pass successfully.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Secrets Masker for non-string values [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #71685: Fix Secrets Masker for non-string values
URL: https://github.com/apache/airflow/pull/71685
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Secrets Masker for non-string values [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #71685:
URL: https://github.com/apache/airflow/pull/71685#issuecomment-5316577957
Thanks for this, and sorry to close it.
This duplicates #71279, which makes the identical production change — the same `_redact_all` guard becomes `not isinstance(item, (dict, tuple, set, list))` — and was opened on 7 August, nine days before this one.
#71279 also carries a few things this PR doesn't: a newsfragment, a fail-closed backstop on the final `return` rather than returning `item`, and a test class covering int, float, bool, `None` and bytes, plus the `merge()` round trip that restores the original value.
Airflow does allow parallel work on the same problem — "better PR wins" — but the convention is to check for an existing PR before starting. No criticism intended; the diagnosis here was right. Closing in favour of #71279.
---
_Drafted by an AI assistant and may contain mistakes — if you think this call is wrong, say so and the PR will be reopened; a human maintainer has the final word._
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org