Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Replace password in URI by stars if present to avoid leaking secrets in logs#1198
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
3a4fc6a
1d43a75
b650c4f
f7180d5
f7968d1
50cbafc
ffddedf
d283c83
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -238,6 +238,21 @@ def test_clone_from_with_path_contains_unicode(self): | ||
except UnicodeEncodeError: | ||
self.fail('Raised UnicodeEncodeError') | ||
@with_rw_directory | ||
def test_leaking_password_in_clone_logs(self, rw_dir): | ||
password = "fakepassword1234" | ||
try: | ||
Repo.clone_from( | ||
url="https://fakeuser:{}@fakerepo.example.com/testrepo".format( | ||
password), | ||
to_path=rw_dir) | ||
except GitCommandError as err: | ||
assert password not in str(err), "The error message '%s' should not contain the password" % err | ||
# Working example from a blank private project | ||
Repo.clone_from( | ||
url="https://gitlab+deploy-token-392045:mLWhVus7bjLsy8xj8q2V@gitlab.com/mercierm/test_git_python", | ||
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. This might be a danger as it breaks the self-isolation even more (after all, GitPythons test rely on its own repository already), but I think it's OK to go with it and fix it when it breaks. 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 agree! I simply did not find another way to test the working use case. Maybe we can use a deploy token with the GitPython repository on Github but I think it is not available for public repo. Maybe you can create a private repo inside the 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 thought about that too and will do that when it breaks. It's certainly the lazy way of doing things and it's basically a mine that is primed to blow sometime in the future, but… it's going to be okay ;). While writing this I thought to myself that I don't want to be that lazy and took a look at the github ways of doing this. It turns out it only supports repository deploy keys, which indeed are full blown ssh keys that I don't want to deal with right now. This makes your account one of the pillars of the happiness of GitPython's CI, something not everyone can say about themselves :D. | ||
to_path=rw_dir) | ||
@with_rw_repo('HEAD') | ||
def test_max_chunk_size(self, repo): | ||
class TestOutputStream(TestBase): | ||