pub enum FxaEvent {
Initialize {
device_config: DeviceConfig,
},
BeginOAuthFlow {
scopes: Vec<String>,
entrypoint: String,
},
BeginPairingFlow {
pairing_url: String,
scopes: Vec<String>,
entrypoint: String,
},
CompleteOAuthFlow {
code: String,
state: String,
},
CancelOAuthFlow,
CheckAuthorizationStatus,
Disconnect,
CallGetProfile,
}
Expand description
Fxa event
These are the events that consumers send to [crate::FxaStateMachine::process_event]
Variants§
Initialize
Initialize the state machine. This must be the first event sent.
Fields
device_config: DeviceConfig
BeginOAuthFlow
Begin an oauth flow
If successful, the state machine will transition the FxaState::Authenticating. The next
step is to navigate the user to the oauth_url
and let them sign and authorize the client.
BeginPairingFlow
Begin an oauth flow using a URL from a pairing code
If successful, the state machine will transition the FxaState::Authenticating. The next
step is to navigate the user to the oauth_url
and let them sign and authorize the client.
CompleteOAuthFlow
Complete an OAuth flow.
Send this event after the user has navigated through the OAuth flow and has reached the
redirect URI. Extract code
and state
from the query parameters or web channel. If
successful the state machine will transition to FxaState::Connected.
CancelOAuthFlow
Cancel an OAuth flow.
Use this to cancel an in-progress OAuth, returning to FxaState::Disconnected so the process can begin again.
CheckAuthorizationStatus
Check the authorization status for a connected account.
Send this when issues are detected with the auth tokens for a connected account. It will double check for authentication issues with the account. If it detects them, the state machine will transition to FxaState::AuthIssues. From there you can start an OAuth flow again to re-connect the user.
Disconnect
Disconnect the user
Send this when the user is asking to be logged out. The state machine will transition to FxaState::Disconnected.
CallGetProfile
Force a call to FirefoxAccount::get_profile
This is used for testing the auth/network retry code, since it hits the network and requires and auth token.
Trait Implementations§
impl Eq for FxaEvent
impl StructuralPartialEq for FxaEvent
Auto Trait Implementations§
impl Freeze for FxaEvent
impl RefUnwindSafe for FxaEvent
impl Send for FxaEvent
impl Sync for FxaEvent
impl Unpin for FxaEvent
impl UnwindSafe for FxaEvent
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
key
and return true
if they are equal.§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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more