pub struct AuthDispatcher { /* private fields */ }Expand description
Dispatches vault unlock across registered authentication backends.
Backend priority order:
- SSH-agent (non-interactive, if enrolled and agent available)
- Password (interactive fallback)
Implementations§
Source§impl AuthDispatcher
impl AuthDispatcher
pub fn new() -> Self
Sourcepub fn backends(&self) -> &[Box<dyn VaultAuthBackend>]
pub fn backends(&self) -> &[Box<dyn VaultAuthBackend>]
Access all registered backends.
Sourcepub async fn applicable_backends(
&self,
profile: &TrustProfileName,
config_dir: &Path,
meta: &VaultMetadata,
) -> Vec<&dyn VaultAuthBackend>
pub async fn applicable_backends( &self, profile: &TrustProfileName, config_dir: &Path, meta: &VaultMetadata, ) -> Vec<&dyn VaultAuthBackend>
Determine which backends are applicable for a vault given its metadata.
A backend is applicable if it is enrolled in the vault metadata AND can currently perform an unlock.
Sourcepub async fn find_auto_backend(
&self,
profile: &TrustProfileName,
config_dir: &Path,
) -> Option<&dyn VaultAuthBackend>
pub async fn find_auto_backend( &self, profile: &TrustProfileName, config_dir: &Path, ) -> Option<&dyn VaultAuthBackend>
Find the first non-interactive backend that is enrolled AND available.
Sourcepub async fn can_auto_unlock(
&self,
profile: &TrustProfileName,
config_dir: &Path,
meta: &VaultMetadata,
) -> bool
pub async fn can_auto_unlock( &self, profile: &TrustProfileName, config_dir: &Path, meta: &VaultMetadata, ) -> bool
Determine if all required factors for a policy can be satisfied without interaction (auto-unlock feasibility check).
Sourcepub fn password_backend(&self) -> &dyn VaultAuthBackend
pub fn password_backend(&self) -> &dyn VaultAuthBackend
Get the password backend (always available as fallback).
§Panics
Panics if the password backend was not registered (this is a programming error — the constructor always registers it).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthDispatcher
impl !RefUnwindSafe for AuthDispatcher
impl Send for AuthDispatcher
impl Sync for AuthDispatcher
impl Unpin for AuthDispatcher
impl !UnwindSafe for AuthDispatcher
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