-
Notifications
You must be signed in to change notification settings - Fork 518
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
feat(gcs): allow setting a token directly #4978
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5278aaf
feat: add token to gcsconfig
jdockerty 9e1badf
feat: add bearer token to header requests
jdockerty b236f5b
feat: add token to builder
jdockerty 3adbe47
feat: make token optional
jdockerty 91887b8
feat: place token within header
jdockerty adbd57a
chore: merge main, fix conflict
jdockerty afb7ef0
feat: pass scope to gcs core
jdockerty b36ca3b
feat: return token directly from load_token if set
jdockerty 55fc762
refactor: use tuple match for token/scope handling
jdockerty 32d1b1d
fix: use default scope set for gcscore
jdockerty 3346244
fix: scope must be valid
jdockerty 2a98679
revert: do not change sign logic
jdockerty f1a78d7
revert: do not change sign_query logic
jdockerty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We don't need to change the logic here since
load_token
has already handled this.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.
Makes sense 👍
Do I understand rightly that the same is also true for
sign_query
? I.e. my addition here should also be removed.opendal/core/src/services/gcs/core.rs
Lines 163 to 170 in 55fc762
I've added ☝️, but the
sign_query
is handled throughload_credential
and notload_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.
Oh, this part is a bit complex. Let me elaborate.
GCS's token-based authorization doesn't support signed queries. Signed queries involve credentials to build presigned URLs, similar to AWS S3. We can't build such presigned URLs using a token. So if users only set a token but not credentials, the signed query won't work.
However, I believe the changes here are the same, and we don't need to alter code
sign_xxx
. Just letload_xxx
handle it.