-
Notifications
You must be signed in to change notification settings - Fork 478
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
fix(gcs): do not skip signing with allow_anonymous
#4979
Conversation
@@ -112,9 +112,6 @@ impl GcsCore { | |||
} | |||
|
|||
pub async fn sign<T>(&self, req: &mut Request<T>) -> Result<()> { | |||
if self.allow_anonymous { |
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.
Thanks so much for the quick fix. Could you also help with load_token
? I think the logic should be to skip signing if token.is_none()
. Additionally, load_token
should correctly manage allow_anonymous
.
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.
skip signing if token.is_none()
I believe this is for the other PR which introduces the token: Option<String>
field?
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 believe this is for the other PR which introduces the
token: Option<String>
field?
I mean:
load_token()
should returnResult<Option<GoogleToken>>
- if
self.token
isSome()
, we should return it firstload_token
. (this can be done in the other PR) - If
load_token()
returnsNone
,sign
should skip it.
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.
Ah yeah, I believe we're talking about the same things here.
I pushed 54c1ae8 just as you wrote this. I believe this covers what you mention here.
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.
Great, thanks!
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.
Looks good to me now, thanks a lot!
This is the last PR I gonna to merge today. I will review your other PR tomorrow. |
No problem! Get some sleep 🚀 |
@Xuanwo If you don't mind, as a small follow-up on this one. Do I understand rightly that I need slightly alter how the Reading the Java implementation from Iceberg's FileIO, the I think the equivalent of that here is that the impl GcsCore {
async fn load_token(&self) -> Result<Option<GoogleToken>> {
if self.allow_anonymous {
return Ok(None);
}
// proceed to load... I ask because the tests I have for the |
Hi @jdockerty, I believe |
Ah! Thank you, that is the piece I was missing 👍 |
Which issue does this PR close?
Fixes an oversight I made in #4965
Rationale for this change
allow_anonymous
is for allowing access when explicitly allowed and credentials are not given (e.g. public buckets) and not for skipping signing entirely.