pub struct ApplicationDefaultCredentialsAuthenticator;
Expand description

Create an authenticator that uses a application default credentials.


    let opts = ApplicationDefaultCredentialsFlowOpts::default();
    let authenticator = match ApplicationDefaultCredentialsAuthenticator::builder(opts).await {
        ApplicationDefaultCredentialsTypes::InstanceMetadata(auth) => auth
            .build()
            .await
            .expect("Unable to create instance metadata authenticator"),
        ApplicationDefaultCredentialsTypes::ServiceAccount(auth) => auth
            .build()
            .await
            .expect("Unable to create service account authenticator"),
    };

Implementations

Try to build ServiceAccountFlowOpts from the environment

Available on crate features hyper-rustls or hyper-tls only.

Use the builder pattern to deduce which model of authenticator should be used: Service account one or GCE instance metadata kind

Use the builder pattern to deduce which model of authenticator should be used and allow providing a hyper client

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more