pub struct LocalBackend;Expand description
The CLI’s backend: consults config.yaml for the account’s
TokenStorage and dispatches to the keychain or file store.
Trait Implementations§
Source§impl Clone for LocalBackend
impl Clone for LocalBackend
impl Copy for LocalBackend
Source§impl Debug for LocalBackend
impl Debug for LocalBackend
Source§impl Default for LocalBackend
impl Default for LocalBackend
Source§impl TokenBackend for LocalBackend
impl TokenBackend for LocalBackend
Source§fn on_access_token(&self, email: &str, access_token: &str)
fn on_access_token(&self, email: &str, access_token: &str)
Opportunistic backfill: accounts added before pidge requested the
openid scope have an empty tenant_id in config. Microsoft Graph
access tokens are JWTs that carry the tid claim, so we can fix
this once per such account on the next Graph call without any
user action. Silent on any failure: cosmetic, not a correctness
requirement.
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TokenSet>, ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TokenSet>, ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the stored tokens for
email. Ok(None) means “no session”.Source§fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
email: &'life1 str,
tokens: &'life2 TokenSet,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
email: &'life1 str,
tokens: &'life2 TokenSet,
) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist
tokens for email, replacing whatever was stored before.Auto Trait Implementations§
impl Freeze for LocalBackend
impl RefUnwindSafe for LocalBackend
impl Send for LocalBackend
impl Sync for LocalBackend
impl Unpin for LocalBackend
impl UnsafeUnpin for LocalBackend
impl UnwindSafe for LocalBackend
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