-
Notifications
You must be signed in to change notification settings - Fork 19
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
Adds support for base64 and OAuth bearer tokens #24
Conversation
headers["Authorization"] = "Basic " + base64.b64encode(token.encode()).decode() | ||
headers["Authorization"] = f"Basic {base64.b64encode(token.encode()).decode()}" | ||
elif Utils.is_base64(self.password): | ||
headers["Authorization"] = f"Basic {self.password}" |
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.
perhaps we should allow users to specify the Authorization header directly here.
Then we dont have to care about what users actually auths with.
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.
I don't think that there is a need. This works with basic auth and OAuth. If there is a need then we can add it.
But, I rather not add things that might be used.
@jimisola needs a format then I'll merge it |
Too many context changes today. Fixed it now. Thanks. |
@jimisola released as 0.3.1 |
This MR adds support for:
I've also:
changed parsing library to argparse
added Utils class
removed all relative import (the try-import with sys.path.append in main.py is to allow the main.py to be run directly when developing)
Done regression tests (there is a unit test for non-auth download).
manually tested base64-encoded "username:password" tokens
NOTE: OAuth bearer token has not been tested because I have no easy way of testing it (Nexus does not support OAuth and I'm not aware of any GitLab och GitHub Maven repos to test with). My colleague has reviewed the code. A note in the changelog about the feature not being tested would be good.
Closes: #23