pub struct Credential {
pub token: String,
pub expires_at: String,
pub cached_at: String,
pub provider: String,
pub env: String,
pub realm: String,
pub identity: String,
pub sub: String,
pub account_type: String,
}Expand description
Credential returned by an auth provider.
Field names and omission behavior match the provider JSON contract. Empty strings are accepted because some providers omit optional values.
Fields§
§token: StringAccess token used by transport injectors.
expires_at: StringExplicit expiration timestamp.
cached_at: StringCache creation timestamp. When present, CACHE_TTL determines expiry.
provider: StringProvider that produced this credential.
env: StringEnvironment this credential targets.
realm: StringEnvironment alias accepted from provider responses.
identity: StringHuman-readable identity.
sub: StringSubject identifier.
account_type: StringAccount type associated with the credential.
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn effective_expiry(&self) -> String
pub fn effective_expiry(&self) -> String
Returns the timestamp used for status display.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Reports whether the credential is expired.
Invalid expires_at values are treated as expired. Credentials without
either expires_at or cached_at are treated as not expired.
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 (const: unstable) · 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 Default for Credential
impl Default for Credential
Source§fn default() -> Credential
fn default() -> Credential
Returns the “default value” for a type. Read more
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
impl Eq for Credential
Source§impl PartialEq for Credential
impl PartialEq for Credential
Source§fn eq(&self, other: &Credential) -> bool
fn eq(&self, other: &Credential) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Credential
impl Serialize 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.