Skip to content

Obfuscate Bearer Token values in logs#16164

Merged
zanieb merged 4 commits intomainfrom
zb/token-obf
Oct 13, 2025
Merged

Obfuscate Bearer Token values in logs#16164
zanieb merged 4 commits intomainfrom
zb/token-obf

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Oct 7, 2025

Sometimes a credential's Debug formatted value appears in tracing logs - make sure the credential doesn't appear there.

Test plan

Added a test case + ran

uv pip install --default-index $PYX_API_URL/$SOME_INDEX $SOME_PACKAGE -vv

With an authenticated uv client and confirmed the tokens are obfuscated.

@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Oct 7, 2025
@zanieb zanieb temporarily deployed to uv-test-registries October 7, 2025 21:30 — with GitHub Actions Inactive
@zanieb
Copy link
Copy Markdown
Member Author

zanieb commented Oct 7, 2025

cc @zsol

@zsol
Copy link
Copy Markdown
Member

zsol commented Oct 9, 2025

Want me to take over, write tests and ship?

@zanieb
Copy link
Copy Markdown
Member Author

zanieb commented Oct 9, 2025

Feel free

@zsol zsol marked this pull request as ready for review October 13, 2025 11:18
@zsol zsol temporarily deployed to uv-test-registries October 13, 2025 11:18 — with GitHub Actions Inactive
@zsol zsol temporarily deployed to uv-test-publish October 13, 2025 11:19 — with GitHub Actions Inactive
@zsol zsol requested a review from charliermarsh October 13, 2025 11:19
Copy link
Copy Markdown
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

spiderman

}
}

#[derive(Clone, PartialEq, Eq, Ord, PartialOrd, Hash, Default, Serialize, Deserialize)]
Copy link
Copy Markdown
Member

@konstin konstin Oct 13, 2025

Choose a reason for hiding this comment

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

Do we ever expect to write this token to a (plain text) file through serde? Otherwise we can drop the Serialize and avoid accidentally writing it out as part of a larger struct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good call, I don't think Serialize is actually used. Dropping

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, we do — in the same way as Password. We just don't support bearer authentication outside of pyx yet, but we will in the future.

We can add it back then though.

@zsol zsol temporarily deployed to uv-test-registries October 13, 2025 12:48 — with GitHub Actions Inactive
@zanieb zanieb merged commit 15829bb into main Oct 13, 2025
100 checks passed
@zanieb zanieb deleted the zb/token-obf branch October 13, 2025 13:28
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 17, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.2` -> `0.9.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.3`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#093)

[Compare Source](astral-sh/uv@0.9.2...0.9.3)

Released on 2025-10-14.

##### Python

- Add CPython 3.15.0a1
- Add CPython 3.13.9

##### Enhancements

- Obfuscate secret token values in logs ([#&#8203;16164](astral-sh/uv#16164))

##### Bug fixes

- Fix workspace with relative pathing ([#&#8203;16296](astral-sh/uv#16296))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDguNiIsInVwZGF0ZWRJblZlciI6IjQxLjE0OC42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants