From c6f8bb5b913216695aa6843dfc8d7b62505861a3 Mon Sep 17 00:00:00 2001 From: Justin Abrahms Date: Sat, 23 Dec 2023 05:26:51 -0800 Subject: [PATCH] Document default value of InstanceCredentialProvider (#5188) * Document default value of InstanceCredentialProvider * Move docs to credentials field rather than crate-private method * Review feedback * Tweak doctest --------- Co-authored-by: Raphael Taylor-Davies --- object_store/src/gcp/builder.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/object_store/src/gcp/builder.rs b/object_store/src/gcp/builder.rs index 7417ea4c8a50..21b767ddbb51 100644 --- a/object_store/src/gcp/builder.rs +++ b/object_store/src/gcp/builder.rs @@ -78,18 +78,16 @@ impl From for crate::Error { } } -/// Configure a connection to Google Cloud Storage using the specified -/// credentials. +/// Configure a connection to Google Cloud Storage. +/// +/// If no credentials are explicitly provided, they will be sourced +/// from the environment as documented [here](https://cloud.google.com/docs/authentication/application-default-credentials). /// /// # Example /// ``` /// # let BUCKET_NAME = "foo"; -/// # let SERVICE_ACCOUNT_PATH = "/tmp/foo.json"; /// # use object_store::gcp::GoogleCloudStorageBuilder; -/// let gcs = GoogleCloudStorageBuilder::new() -/// .with_service_account_path(SERVICE_ACCOUNT_PATH) -/// .with_bucket_name(BUCKET_NAME) -/// .build(); +/// let gcs = GoogleCloudStorageBuilder::from_env().with_bucket_name(BUCKET_NAME).build(); /// ``` #[derive(Debug, Clone)] pub struct GoogleCloudStorageBuilder {