Skip to content

Hide password in the index printed via --emit-index-annotation#3112

Merged
charliermarsh merged 3 commits into
astral-sh:mainfrom
ChannyClaus:hide-password
Apr 18, 2024
Merged

Hide password in the index printed via --emit-index-annotation#3112
charliermarsh merged 3 commits into
astral-sh:mainfrom
ChannyClaus:hide-password

Conversation

@ChannyClaus

@ChannyClaus ChannyClaus commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

Summary

resolves #3106

Test Plan

added a simple test where the password provided in UV_INDEX_URL is hidden in the output as expected.

// Hide the password.
let _ = url.set_password(Some("****"));
}
writeln!(f, "{}", format!(" # from {url}").green())?;

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.

Maybe we should just omit the username and password entirely -- what do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yup, that is cleaner. making the changes -

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.

Just moved it out to a method. Thanks!

@charliermarsh charliermarsh left a comment

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.

Thanks!

@charliermarsh charliermarsh changed the title hide password in the index printed via --emit-index-annotation Hide password in the index printed via --emit-index-annotation Apr 18, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Apr 18, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) April 18, 2024 03:55
@charliermarsh charliermarsh merged commit 8c7d0a3 into astral-sh:main Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--emit-index-annotation should redact usernames and passwords in index URL

2 participants