Skip to content
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

new feature: allow GCP unauthenticated requests #4963

Closed
1 task done
jdockerty opened this issue Aug 5, 2024 · 1 comment · Fixed by #4965
Closed
1 task done

new feature: allow GCP unauthenticated requests #4963

jdockerty opened this issue Aug 5, 2024 · 1 comment · Fixed by #4965
Labels
enhancement New feature or request

Comments

@jdockerty
Copy link
Contributor

Feature Description

Allow unauthenticated requests to a GCS (or emulated) bucket.

Problem and Solution

This enables simpler testing and looks to be the same reasoning for why the Java implementation has this too.

Additional Context

I ran into this whilst looking at adding GCS support to iceberg-rust.

Happy to help contribute this with some guidance 👍

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.
@jdockerty jdockerty added the enhancement New feature or request label Aug 5, 2024
@Xuanwo
Copy link
Member

Xuanwo commented Aug 5, 2024

Thanks a lot in advance!

To support unauthenticated requests, we take a reference from S3::allow_anonymous.

We might need to have the following fields for gcs config:

  • allow_anonymous
  • disable_disable_vm_metadata
  • disable_config_load

And implement something like this for gcs:

async fn load_credential(&self) -> Result<Option<AwsCredential>> {
let cred = self
.loader
.load_credential(self.client.client())
.await
.map_err(new_request_credential_error)?;
if let Some(cred) = cred {
// Update credential_loaded to true if we have load credential successfully.
self.credential_loaded
.store(true, atomic::Ordering::Relaxed);
return Ok(Some(cred));
}
// If we have load credential before but failed to load this time, we should
// return error instead.
if self.credential_loaded.load(atomic::Ordering::Relaxed) {
return Err(Error::new(
ErrorKind::PermissionDenied,
"credential was previously loaded successfully but has failed this time",
)
.set_temporary());
}
// Credential is empty and users allow anonymous access, we will not sign the request.
if self.allow_anonymous {
return Ok(None);
}
Err(Error::new(
ErrorKind::PermissionDenied,
"no valid credential found and anonymous access is not allowed",
))
}

Please let me know if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants