pub struct ChainedCredentialProvider { /* private fields */ }Expand description
Try a sequence of CredentialProviders in order, returning
the first one that resolves successfully. A provider that
returns AuthError::Missing (the configured “not my source”
signal) is skipped; any other Error short-circuits and is
returned to the caller — failed-but-real credential sources
must surface their failure rather than silently fall through.
Typical layout: try environment first, fall back to vault, fall
back to instance metadata. The chain is built once at
transport-construction time; resolve is hot-path safe.
Implementations§
Source§impl ChainedCredentialProvider
impl ChainedCredentialProvider
Sourcepub const fn new(providers: Vec<Arc<dyn CredentialProvider>>) -> Self
pub const fn new(providers: Vec<Arc<dyn CredentialProvider>>) -> Self
Build a chain from the supplied provider list. An empty list
is permitted but pointless — every resolve call returns
AuthError::Missing.
Trait Implementations§
Source§impl CredentialProvider for ChainedCredentialProvider
impl CredentialProvider for ChainedCredentialProvider
Source§fn resolve<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Credentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn resolve<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Credentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve current credentials. Long-running impls should respect
tokio cancellation in their internals; the transport supplies the
ExecutionContext indirectly via the surrounding async task.Auto Trait Implementations§
impl Freeze for ChainedCredentialProvider
impl !RefUnwindSafe for ChainedCredentialProvider
impl Send for ChainedCredentialProvider
impl Sync for ChainedCredentialProvider
impl Unpin for ChainedCredentialProvider
impl UnsafeUnpin for ChainedCredentialProvider
impl !UnwindSafe for ChainedCredentialProvider
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