Ensure HTTP auth persists throughout session - #41
Conversation
|
Thanks for contributing.
|
465351d to
6814c26
Compare
|
Thanks for the feedback! I was having trouble running the tests in CI and when running the tests locally they passed. Opening a PR in my own repo got the actions to run, which were now successful after my last push - https://github.com/cquick01/proxpi/actions/runs/6813566676/job/18528455278?pr=1 Does that satisfy the "comprehensive unit tests and integration tests" or are those separate? I ran 6814c26 should make it so we only update the auth tuple if a username (or username+password) is provided in the url. I believe the points mentioned should be fixed now. Please let me know if there is anything else to do, thanks! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #41 +/- ##
==========================================
- Coverage 89.78% 89.75% -0.03%
==========================================
Files 3 3
Lines 656 664 +8
==========================================
+ Hits 589 596 +7
- Misses 67 68 +1
☔ View full report in Codecov by Sentry. |
New functionality needs new tests. These tests should fail before adding the functionality, and succeed after. This project currently only has integration tests, so don't worry about unit-tests Two more things:
|
6814c26 to
35b28d7
Compare
|
Hi, thanks again for the feedback and sorry for the delay in updating. I updated the tests to support testing with credentials. Rather than creating new tests, added a new fixture that loops through some credentials to test with. This works together with the existing Functionality-wise, it is working with both my private GitLab server as well as public PyPi packages. Please let me know what you think! |
No, what your doing is fine. It matches how users would use this library (with env-vars) One thing is I don't know whether the server which files are downloaded from also needs that authentication. I suspect it works for GitLab because it returns pre-signed URLs in the file-list response, but other servers might return relative paths which need to go through the same server (especially important for sibling files, eg metadata). I think this means we need to also pass the authentication to the download-file request |
|
I'm guessing that absent this PR I cannot use proxpi when i have a mix of pypi and private repository (gitlab)? |
In addition, this auth should only be passed to the download-file request if it's the same domain (to prevent leaking credentials to other servers).
@donbowman I think so. If you're able to test this PR and it works for you, please let me know. |
a2c148a to
93ea79d
Compare
Trying to use HTTP-basic authentication with GitLab, but was running into an error
It seemed like the credentials were not being cached properly throughout the session. I dug around a bit, and adding this got things working for my private repo(s) as well as public PyPi.