pub enum GcpCredentials {
AccessToken {
token: String,
},
ServiceAccountKey {
json: String,
},
ServiceMetadata,
ProjectedServiceAccount {
token_file: String,
service_account_email: String,
},
AuthorizedUser {
client_id: String,
client_secret: String,
refresh_token: String,
},
}Expand description
Authentication options for talking to GCP APIs.
Variants§
AccessToken
Use an already-minted OAuth2 access token.
ServiceAccountKey
Use a full Service Account JSON key (as string). A short-lived JWT will be created and exchanged for a bearer token automatically.
ServiceMetadata
Use GCP metadata server for authentication (for instances running on GCP)
ProjectedServiceAccount
Use projected service account token (for Kubernetes workload identity)
Fields
AuthorizedUser
Use gcloud Application Default Credentials (authorized_user). Exchanges refresh_token for an access_token via Google’s OAuth2 endpoint.
Trait Implementations§
Source§impl Clone for GcpCredentials
impl Clone for GcpCredentials
Source§fn clone(&self) -> GcpCredentials
fn clone(&self) -> GcpCredentials
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GcpCredentials
impl Debug for GcpCredentials
Source§impl<'de> Deserialize<'de> for GcpCredentials
impl<'de> Deserialize<'de> for GcpCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GcpCredentials
impl PartialEq for GcpCredentials
Source§impl Serialize for GcpCredentials
impl Serialize for GcpCredentials
impl Eq for GcpCredentials
impl StructuralPartialEq for GcpCredentials
Auto Trait Implementations§
impl Freeze for GcpCredentials
impl RefUnwindSafe for GcpCredentials
impl Send for GcpCredentials
impl Sync for GcpCredentials
impl Unpin for GcpCredentials
impl UnsafeUnpin for GcpCredentials
impl UnwindSafe for GcpCredentials
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.