fix(gcs): do not skip signing with allow_anonymous#4979
Conversation
| } | ||
|
|
||
| pub async fn sign<T>(&self, req: &mut Request<T>) -> Result<()> { | ||
| if self.allow_anonymous { |
There was a problem hiding this comment.
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.
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.
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.tokenisSome(), we should return it firstload_token. (this can be done in the other PR) - If
load_token()returnsNone,signshould skip it.
There was a problem hiding this comment.
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.
Xuanwo
left a comment
There was a problem hiding this comment.
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_anonymousis for allowing access when explicitly allowed and credentials are not given (e.g. public buckets) and not for skipping signing entirely.