pub struct OAuth2State {
pub state: String,
pub provider_name: String,
pub redirect_uri: Option<String>,
pub user_id: String,
pub scopes: Vec<String>,
pub metadata: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
}Expand description
OAuth2 flow state for managing authorization flows
Fields§
§state: StringRandom state parameter for security
provider_name: StringProvider name for this OAuth flow
redirect_uri: Option<String>Redirect URI for the OAuth flow (if the provider requires it)
user_id: StringUser ID if available
scopes: Vec<String>Requested scopes
metadata: HashMap<String, Value>Additional metadata
created_at: DateTime<Utc>State creation time
Implementations§
Source§impl OAuth2State
impl OAuth2State
Sourcepub fn new_with_state(
state: String,
provider_name: String,
redirect_uri: Option<String>,
user_id: String,
scopes: Vec<String>,
) -> Self
pub fn new_with_state( state: String, provider_name: String, redirect_uri: Option<String>, user_id: String, scopes: Vec<String>, ) -> Self
Create a new OAuth2 state with provided state parameter
Sourcepub fn new(
provider_name: String,
redirect_uri: Option<String>,
user_id: String,
scopes: Vec<String>,
) -> Self
pub fn new( provider_name: String, redirect_uri: Option<String>, user_id: String, scopes: Vec<String>, ) -> Self
Create a new OAuth2 state with auto-generated state parameter (deprecated)
Sourcepub fn is_expired(&self, max_age_seconds: i64) -> bool
pub fn is_expired(&self, max_age_seconds: i64) -> bool
Check if the state has expired (default 10 minutes)
Trait Implementations§
Source§impl Clone for OAuth2State
impl Clone for OAuth2State
Source§fn clone(&self) -> OAuth2State
fn clone(&self) -> OAuth2State
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 OAuth2State
impl Debug for OAuth2State
Source§impl<'de> Deserialize<'de> for OAuth2State
impl<'de> Deserialize<'de> for OAuth2State
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 OAuth2State
impl RefUnwindSafe for OAuth2State
impl Send for OAuth2State
impl Sync for OAuth2State
impl Unpin for OAuth2State
impl UnsafeUnpin for OAuth2State
impl UnwindSafe for OAuth2State
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