pub enum Credential {
ApiKey {
key: String,
},
Bearer {
token: String,
expires_at: Option<DateTime<Utc>>,
},
OAuth2 {
access_token: String,
refresh_token: Option<String>,
expires_at: Option<DateTime<Utc>>,
token_url: String,
client_id: String,
client_secret: Option<String>,
scopes: Vec<String>,
},
}Expand description
A secret value with type information for tool authentication.
Variants§
ApiKey
A single secret API key string.
Bearer
A bearer token with optional expiry.
Fields
OAuth2
A full OAuth2 token set with refresh capability.
Fields
Implementations§
Source§impl Credential
impl Credential
Sourcepub const fn credential_type(&self) -> CredentialType
pub const fn credential_type(&self) -> CredentialType
Returns the CredentialType discriminant for this credential.
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
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 Credential
impl Debug for Credential
Source§impl<'de> Deserialize<'de> for Credential
impl<'de> Deserialize<'de> for Credential
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
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
Mutably borrows from an owned value. Read more