Repository navigation
Keep the URL scheme out of path masking in airflow info --anonymize - #73599
Conversation
Since apache#73179 a netloc-less connection string is masked through the unanchored username substitution, so an OS username that happens to be a substring of the scheme (e.g. "lite" or "db") corrupts the scheme itself: "sqlite:" becomes "sq${USER}:". Splitting on the first colon puts the scheme out of the substitution's reach; non-URL fallback values such as "NOT AVAILABLE" stay intact for the same reason. Suggested as an optional follow-up in the review of apache#73179.
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 8b4e4df v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
|
Hi maintainer, this PR was merged without a milestone set.
|
|
Thanks @wiasliaw for picking this :) |
…#73179, #73599) (#73603) * Mask the SQLite database path in airflow info --anonymize (#73179) The whole point of --anonymize is that the report is safe to paste into a public bug report. SQLite is the default backend, so the people most likely to rely on that promise are exactly the ones it was broken for. Co-authored-by: Eason09053360 <[email protected]> (cherry picked from commit 41480ac) * Keep the URL scheme out of path masking in airflow info --anonymize (#73599) Since #73179 a netloc-less connection string is masked through the unanchored username substitution, so an OS username that happens to be a substring of the scheme (e.g. "lite" or "db") corrupts the scheme itself: "sqlite:" becomes "sq${USER}:". Splitting on the first colon puts the scheme out of the substitution's reach; non-URL fallback values such as "NOT AVAILABLE" stay intact for the same reason. Suggested as an optional follow-up in the review of #73179. (cherry picked from commit 8b4e4df) --------- Co-authored-by: Y-C <[email protected]> Co-authored-by: Eason09053360 <[email protected]> Co-authored-by: wiasliaw <[email protected]>
Why
#73179 made
airflow info --anonymizemask a netloc-less connection string by handing the whole value toprocess_path, whose username substitution is an unanchored substring replacement — so the scheme itself is in the replacement's reach. An OS username that happens to be a substring of the scheme corrupts the report:This was called out as an optional follow-up in the review of #73179.
What
airflow-core/src/airflow/cli/commands/info_command.py— the netloc-less branch ofPiiAnonymizer.process_urlnow splits the value on the first colon and masks only what follows, so the scheme is out of the substitution's reach. Output is byte-identical for every realistic input (checked against the Dockersqlite:////opt/${USER}/${USER}.dbcase,sqlite:///:memory:,sqlite://); a side effect is that non-URL fallback values such asNOT AVAILABLEare no longer touched by the substitution either.Covered by a new parametrized test that mocks
getuser/expanduserto force the colliding usernames; all three cases fail without the change, and the existingtest_should_remove_pii_from_urlcases are unchanged.No newsfragment: CLI output fix, not a major or breaking change.
related: #73179
Verification
Run the anonymizer unit tests:
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines