pub enum Credential {
Bearer(String),
Header {
name: String,
value: String,
},
Basic {
username: String,
password: String,
},
Token(String),
}Expand description
A resolved credential produced by an AuthProvider or built from inline
auth config. Connectors map this onto their wire protocol (HTTP header, gRPC
metadata, …).
Intentionally not #[non_exhaustive]: connectors must map every variant,
so adding one should be a compile error that forces correct handling rather
than a silently-ignored fallback.
Variants§
Bearer(String)
Authorization: Bearer <token>.
Header
An explicit header name + value.
Basic
HTTP Basic credentials.
Token(String)
A raw token for connector-specific assembly (e.g. gRPC authorization
metadata, Snowflake’s Authorization with a token-type header).
Implementations§
Source§impl Credential
impl Credential
The value to use for an Authorization header, when this credential maps
to one. Returns None for credentials that are applied differently
(e.g. Credential::Basic, which connectors apply via basic-auth, or
Credential::Header, which carries its own name).
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Credential
impl Debug for Credential
Source§impl PartialEq for Credential
impl PartialEq for Credential
Source§fn eq(&self, other: &Credential) -> bool
fn eq(&self, other: &Credential) -> bool
self and other values to be equal, and is used by ==.impl Eq for Credential
impl StructuralPartialEq for Credential
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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
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
key and return true if they are equal.