Redact new index credentials in uv add (#10329)

## Summary

Closes https://github.com/astral-sh/uv/issues/10328.
This commit is contained in:
Charlie Marsh 2025-01-06 12:24:05 -05:00 committed by GitHub
parent 66a603b6c4
commit 243d2f8d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 88 additions and 1 deletions

View file

@ -303,7 +303,7 @@ impl PyProjectTomlMut {
.and_then(|url| Url::parse(url).ok())
.is_none_or(|url| CanonicalUrl::new(&url) != CanonicalUrl::new(index.url.url()))
{
let mut formatted = Formatted::new(index.url.to_string());
let mut formatted = Formatted::new(index.url.redacted().to_string());
if let Some(value) = table.get("url").and_then(Item::as_value) {
if let Some(prefix) = value.decor().prefix() {
formatted.decor_mut().set_prefix(prefix.clone());