pub struct ProviderExchange {
pub subject: String,
pub email: Option<String>,
pub email_verified: Option<bool>,
pub access_token: String,
pub refresh_token: Option<String>,
pub expires_in: Option<u64>,
pub id_token: Option<String>,
}Expand description
Normalized result of a successful upstream code exchange or refresh,
common to every OAuthProvider implementation.
id_token is Some for OIDC-shaped providers (Google, Authelia) and
None for plain-OAuth2 providers with no ID token (GitHub).
access_token/refresh_token/id_token are #[serde(skip_serializing)]
as defense-in-depth: nothing in this plan serializes a whole
ProviderExchange to a client response or log line today (every call
site destructures individual non-secret fields), but nothing about the
type’s shape should make that mistake easy for a future edit to make
silently — nothing in this crate’s existing secret-handling discipline
(fingerprint()-before-log everywhere else) relies on “don’t accidentally
serialize the whole struct” being enforced only by convention.
Debug is hand-rolled (not derived) to match: it redacts access_token,
refresh_token, and id_token the same way {:?} printing must not leak
secrets — see GoogleConfig/AutheliaConfig/GitHubConfig and the
per-provider OAuthProvider impls for the established pattern in this
crate.
Fields§
§subject: String§email: Option<String>§email_verified: Option<bool>§access_token: String§refresh_token: Option<String>§expires_in: Option<u64>§id_token: Option<String>Trait Implementations§
Source§impl Clone for ProviderExchange
impl Clone for ProviderExchange
Source§fn clone(&self) -> ProviderExchange
fn clone(&self) -> ProviderExchange
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 ProviderExchange
impl Debug for ProviderExchange
Source§impl<'de> Deserialize<'de> for ProviderExchange
impl<'de> Deserialize<'de> for ProviderExchange
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>,
Source§impl PartialEq for ProviderExchange
impl PartialEq for ProviderExchange
Source§fn eq(&self, other: &ProviderExchange) -> bool
fn eq(&self, other: &ProviderExchange) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ProviderExchange
impl Serialize for ProviderExchange
impl Eq for ProviderExchange
impl StructuralPartialEq for ProviderExchange
Auto Trait Implementations§
impl Freeze for ProviderExchange
impl RefUnwindSafe for ProviderExchange
impl Send for ProviderExchange
impl Sync for ProviderExchange
impl Unpin for ProviderExchange
impl UnsafeUnpin for ProviderExchange
impl UnwindSafe for ProviderExchange
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.