pub struct Dispatcher { /* private fields */ }Expand description
Routes auth operations to registered providers by name.
Clones share the same provider registry, so provider facades and transport injectors see later registration or replacement.
Implementations§
Source§impl Dispatcher
impl Dispatcher
Sourcepub fn register(&mut self, provider: Arc<dyn AuthProvider>)
pub fn register(&mut self, provider: Arc<dyn AuthProvider>)
Registers or replaces a provider under its AuthProvider::name.
Sourcepub fn registered_names(&self) -> Vec<String>
pub fn registered_names(&self) -> Vec<String>
Returns provider names in registration order.
Sourcepub async fn get_credential(
&self,
name: &str,
env: &str,
command: &str,
tier: &str,
) -> Result<Credential>
pub async fn get_credential( &self, name: &str, env: &str, command: &str, tier: &str, ) -> Result<Credential>
Gets a credential from a named provider.
Sourcepub async fn login(&self, name: &str, env: &str) -> Result<Credential>
pub async fn login(&self, name: &str, env: &str) -> Result<Credential>
Clears any cached credential, ignoring logout failures, then authenticates.
Sourcepub async fn status(&self, name: &str, env: &str) -> Result<Credential>
pub async fn status(&self, name: &str, env: &str) -> Result<Credential>
Gets cached credential status from a named provider.
Sourcepub async fn logout(&self, name: &str, env: &str) -> Result<()>
pub async fn logout(&self, name: &str, env: &str) -> Result<()>
Clears cached credentials for a named provider and environment.
Sourcepub async fn all_statuses(&self) -> Vec<StatusEntry>
pub async fn all_statuses(&self) -> Vec<StatusEntry>
Queries every provider for every cached environment it reports.
Sourcepub fn for_provider(&self, name: impl Into<String>) -> SingleProvider
pub fn for_provider(&self, name: impl Into<String>) -> SingleProvider
Returns an auth-provider facade backed by this dispatcher.
Trait Implementations§
Source§impl Clone for Dispatcher
impl Clone for Dispatcher
Source§fn clone(&self) -> Dispatcher
fn clone(&self) -> Dispatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Dispatcher
impl Debug for Dispatcher
Source§impl Default for Dispatcher
impl Default for Dispatcher
Source§fn default() -> Dispatcher
fn default() -> Dispatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Dispatcher
impl RefUnwindSafe for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
impl UnwindSafe for Dispatcher
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