pub struct CredentialChain { /* private fields */ }Expand description
An ordered chain of credential resolvers for a single provider.
Resolvers are tried in priority order (lowest first). The first resolver
that returns Some(credential) wins.
Implementations§
Source§impl CredentialChain
impl CredentialChain
Sourcepub fn new(
provider_name: &'static str,
resolvers: Vec<Box<dyn CredentialResolver>>,
) -> Self
pub fn new( provider_name: &'static str, resolvers: Vec<Box<dyn CredentialResolver>>, ) -> Self
Build a chain for the given provider. Resolvers are sorted by priority.
Sourcepub fn empty(provider_name: &'static str) -> Self
pub fn empty(provider_name: &'static str) -> Self
Build an empty chain (always returns NoCredentials).
Sourcepub fn resolve(&self) -> Result<ResolvedCredential, CredentialError>
pub fn resolve(&self) -> Result<ResolvedCredential, CredentialError>
Resolve credentials by walking the chain in priority order.
Sourcepub fn status(&self) -> Vec<CredentialStatus>
pub fn status(&self) -> Vec<CredentialStatus>
Return status of each resolver in the chain.
Sourcepub fn login_sources(&self) -> Vec<&dyn CredentialResolver>
pub fn login_sources(&self) -> Vec<&dyn CredentialResolver>
Return resolvers that support interactive login.
Sourcepub fn get_resolver(&self, id: &str) -> Option<&dyn CredentialResolver>
pub fn get_resolver(&self, id: &str) -> Option<&dyn CredentialResolver>
Find a resolver by id.
Sourcepub fn resolver_ids(&self) -> impl Iterator<Item = &str>
pub fn resolver_ids(&self) -> impl Iterator<Item = &str>
Iterate over all resolver IDs in priority order.
Sourcepub fn provider_name(&self) -> &str
pub fn provider_name(&self) -> &str
Provider name this chain serves.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CredentialChain
impl !RefUnwindSafe for CredentialChain
impl Send for CredentialChain
impl Sync for CredentialChain
impl Unpin for CredentialChain
impl UnsafeUnpin for CredentialChain
impl !UnwindSafe for CredentialChain
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