pub struct Auth { /* private fields */ }
Implementations§
Source§impl Auth
impl Auth
pub fn new(paths: &LauncherPaths, log: Logger) -> Auth
Sourcepub async fn get_tunnel_authentication(&self) -> Result<Authorization, AnyError>
pub async fn get_tunnel_authentication(&self) -> Result<Authorization, AnyError>
Gets a tunnel Authentication for use in the tunnel management API.
Sourcepub fn get_current_credential(
&self,
) -> Result<Option<StoredCredential>, WrappedError>
pub fn get_current_credential( &self, ) -> Result<Option<StoredCredential>, WrappedError>
Reads the current details from the keyring.
Sourcepub fn clear_credentials(&self) -> Result<(), AnyError>
pub fn clear_credentials(&self) -> Result<(), AnyError>
Clears login info from the keyring.
Sourcepub async fn login(
&self,
provider: Option<AuthProvider>,
access_token: Option<String>,
) -> Result<StoredCredential, AnyError>
pub async fn login( &self, provider: Option<AuthProvider>, access_token: Option<String>, ) -> Result<StoredCredential, AnyError>
Runs the login flow, optionally pre-filling a provider and/or access token.
Sourcepub async fn get_credential(&self) -> Result<StoredCredential, AnyError>
pub async fn get_credential(&self) -> Result<StoredCredential, AnyError>
Gets the currently stored credentials, or asks the user to log in.
Sourcepub async fn keep_token_alive(self) -> Result<(), AnyError>
pub async fn keep_token_alive(self) -> Result<(), AnyError>
Maintains the stored credential by refreshing it against the service to ensure its stays current. Returns a future that should be polled and only errors if a refresh fails in a consistent way.
Trait Implementations§
Source§impl AuthorizationProvider for Auth
impl AuthorizationProvider for Auth
Auto Trait Implementations§
impl Freeze for Auth
impl !RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl !UnwindSafe for Auth
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