-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add support for API auth with access token #482
base: main
Are you sure you want to change the base?
Conversation
4ae8b13
to
e227bdf
Compare
516eceb
to
3721c55
Compare
3721c55
to
7b1f50d
Compare
7b1f50d
to
09b340f
Compare
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 guess something will need to be done also for the tus upload https://github.com/galaxyproject/bioblend/blob/main/bioblend/galaxyclient.py#L330 ?
Ping @natefoo
@nuwang Do you want to rebase this now that the Galaxy PR has been merged? |
elif token: | ||
self.token: Optional[str] = token |
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.
elif token: | |
self.token: Optional[str] = token |
else: | ||
self._key = None | ||
self.email = email | ||
self.password = password | ||
self.json_headers: dict = {"Content-Type": "application/json"} | ||
# json_headers needs to be set before key can be defined, otherwise authentication with email/password causes an error | ||
self.json_headers["x-api-key"] = self.key | ||
if token: | ||
self.json_headers["Authorization"] = f"Bearer {self.token}" |
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.
self.json_headers["Authorization"] = f"Bearer {self.token}" | |
self.json_headers["Authorization"] = f"Bearer {token}" |
Depends on: galaxyproject/galaxy#16977
This is the line where the tus client seems to rely on
x-api-key
that I mentioned @mvdbeek:bioblend/bioblend/galaxyclient.py
Line 329 in 933b910