pub struct DefaultCredentialProvider { /* private fields */ }Expand description
Default credential provider for Google Cloud Storage (GCS).
Resolution order follows ADC (Application Default Credentials):
- Env var
GOOGLE_APPLICATION_CREDENTIALS - Well-known location (
~/.config/gcloud/application_default_credentials.json) - VM metadata service (GCE / Cloud Functions / App Engine)
Implementations§
Source§impl DefaultCredentialProvider
impl DefaultCredentialProvider
Sourcepub fn builder() -> DefaultCredentialProviderBuilder
pub fn builder() -> DefaultCredentialProviderBuilder
Create a builder to configure the default ADC chain for GCS.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new DefaultCredentialProvider with the default chain: env ADC -> well-known ADC -> VM metadata
Sourcepub fn with_chain(chain: ProvideCredentialChain<Credential>) -> Self
pub fn with_chain(chain: ProvideCredentialChain<Credential>) -> Self
Create with a custom credential chain.
Sourcepub fn push_front(
self,
provider: impl ProvideCredential<Credential = Credential> + 'static,
) -> Self
pub fn push_front( self, provider: impl ProvideCredential<Credential = Credential> + 'static, ) -> Self
Add a credential provider to the front of the default chain.
Trait Implementations§
Source§impl Debug for DefaultCredentialProvider
impl Debug for DefaultCredentialProvider
Source§impl Default for DefaultCredentialProvider
impl Default for DefaultCredentialProvider
Source§impl ProvideCredential for DefaultCredentialProvider
impl ProvideCredential for DefaultCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Credential returned by this loader. Read more
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Load signing credential from current env.
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultCredentialProvider
impl !UnwindSafe for DefaultCredentialProvider
impl Freeze for DefaultCredentialProvider
impl Send for DefaultCredentialProvider
impl Sync for DefaultCredentialProvider
impl Unpin for DefaultCredentialProvider
impl UnsafeUnpin for DefaultCredentialProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
Source§type Credential = <T as ProvideCredential>::Credential
type Credential = <T as ProvideCredential>::Credential
Credential returned by this loader.
Source§fn provide_credential_dyn<'a>(
&'a self,
ctx: &'a Context,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
fn provide_credential_dyn<'a>( &'a self, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
Dyn version of
ProvideCredential::provide_credential.