-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redact URL to hide password #6295
Changes from 1 commit
00b872f
34b123d
5c232bc
ddb7320
70dee95
c33535b
1214941
5bfb47c
137a7ab
b37ad3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,19 @@ def test_command_line_options_override_env_vars(script, virtualenv): | |
assert "Getting page https://download.zope.org/ppix" in result.stdout | ||
|
||
|
||
def test_no_password_in_debug_message(script, virtualenv): | ||
""" | ||
Test that password in the URL is not logged | ||
""" | ||
script.environ['PIP_INDEX_URL'] = 'https://user:my_password@example.com/simple/' | ||
result = script.pip('install', '-vvv', 'INITools', expect_error=True) | ||
assert ( | ||
"Getting page https://user:<pwd>@example.com/simple/initools" | ||
in result.stdout | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition, you might as well assert that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
virtualenv.clear() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed? If so, should it be in a finally block? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used |
||
|
||
|
||
@pytest.mark.network | ||
def test_env_vars_override_config_file(script, virtualenv): | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the
redact_password_from_url()
function which has this purpose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know!, Fixed in the next commit