pub struct AuthState {
pub mode: AuthMode,
pub authenticated: bool,
pub email: Option<String>,
pub available_emails: Option<Vec<GitHubEmail>>,
pub github_token: Option<String>,
pub api_url: Option<String>,
pub auth_source: String,
}Expand description
Current authentication state
Tracks the current authentication status and available credentials.
§Example
use data_modelling_sdk::auth::{AuthState, AuthMode};
let state = AuthState {
mode: AuthMode::Web,
authenticated: true,
email: Some("user@example.com".to_string()),
available_emails: None,
github_token: Some("token123".to_string()),
api_url: None,
auth_source: "web".to_string(),
};Fields§
§mode: AuthModeCurrent authentication mode
authenticated: boolWhether the user is currently authenticated
email: Option<String>Selected email address (if authenticated)
available_emails: Option<Vec<GitHubEmail>>Available GitHub emails (for selection during OAuth)
github_token: Option<String>GitHub OAuth token (if authenticated via GitHub)
api_url: Option<String>API URL (for online mode)
auth_source: StringSource of auth flow: “web”, “desktop”, or “mobile”
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthState
impl<'de> Deserialize<'de> for AuthState
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 AuthState
impl StructuralPartialEq for AuthState
Auto Trait Implementations§
impl Freeze for AuthState
impl RefUnwindSafe for AuthState
impl Send for AuthState
impl Sync for AuthState
impl Unpin for AuthState
impl UnwindSafe for AuthState
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,
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.