pub struct OAuthTokens {
pub access_token: SecretString,
pub refresh_token: SecretString,
pub expires_at: DateTime<Utc>,
}Expand description
A persisted OAuth token set for one proxy upstream. Serialized as JSON into
the credential store under a per-server key (e.g. proxy.<name>.oauth).
Fields§
§access_token: SecretString§refresh_token: SecretString§expires_at: DateTime<Utc>Absolute UTC instant the access token expires.
Implementations§
Source§impl OAuthTokens
impl OAuthTokens
Sourcepub fn from_response(
resp: TokenResponse,
now: DateTime<Utc>,
prev_refresh: Option<&str>,
) -> Result<Self, OAuthError>
pub fn from_response( resp: TokenResponse, now: DateTime<Utc>, prev_refresh: Option<&str>, ) -> Result<Self, OAuthError>
Build from a token response, computing expires_at from expires_in
relative to now. Falls back to prev_refresh when the response omits
refresh_token (defensive — the DevBoy AS always rotates and re-sends it).
Trait Implementations§
Source§impl Clone for OAuthTokens
impl Clone for OAuthTokens
Source§fn clone(&self) -> OAuthTokens
fn clone(&self) -> OAuthTokens
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 OAuthTokens
impl Debug for OAuthTokens
Source§impl<'de> Deserialize<'de> for OAuthTokens
impl<'de> Deserialize<'de> for OAuthTokens
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 OAuthTokens
impl RefUnwindSafe for OAuthTokens
impl Send for OAuthTokens
impl Sync for OAuthTokens
impl Unpin for OAuthTokens
impl UnsafeUnpin for OAuthTokens
impl UnwindSafe for OAuthTokens
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