pub struct ChainedTokenCredential { /* private fields */ }Expand description
Tries a sequence of credentials in order, returning the first token
obtained. The index of the first credential to succeed is remembered and
tried first on subsequent calls (re-remembered if a different one later
wins), mirroring azure_identity’s ChainedTokenCredential.
Implementations§
Source§impl ChainedTokenCredential
impl ChainedTokenCredential
Sourcepub fn new(credentials: Vec<Arc<dyn TokenCredential>>) -> Self
pub fn new(credentials: Vec<Arc<dyn TokenCredential>>) -> Self
Build a chain from an ordered list of credentials.
Trait Implementations§
Source§impl TokenCredential for ChainedTokenCredential
impl TokenCredential for ChainedTokenCredential
Source§fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a bearer token to send as
Authorization: Bearer <token>.Source§fn get_token_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_token_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a bearer token for a specific
scope (audience), e.g.
"https://ai.azure.com/.default". Read moreAuto Trait Implementations§
impl !Freeze for ChainedTokenCredential
impl !RefUnwindSafe for ChainedTokenCredential
impl !UnwindSafe for ChainedTokenCredential
impl Send for ChainedTokenCredential
impl Sync for ChainedTokenCredential
impl Unpin for ChainedTokenCredential
impl UnsafeUnpin for ChainedTokenCredential
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