pub struct CachingCredentials { /* private fields */ }Expand description
A credential store that serves the latest minted value for each provider-backed id, and
pre-seeded static secrets for the rest. The data plane calls CredentialStore::resolve
(sync); minting happens out of band in Self::refresh_due.
Implementations§
Source§impl CachingCredentials
impl CachingCredentials
Sourcepub fn new(
static_secrets: HashMap<String, Secret>,
providers: HashMap<String, Arc<dyn CredentialProvider>>,
) -> Self
pub fn new( static_secrets: HashMap<String, Secret>, providers: HashMap<String, Arc<dyn CredentialProvider>>, ) -> Self
A store with the given static secrets and minting providers. Ids must be disjoint; a provider id shadows a static one of the same name.
Sourcepub fn insert_static(&self, id: impl Into<String>, secret: Secret)
pub fn insert_static(&self, id: impl Into<String>, secret: Secret)
Register or replace a static secret (used in tests and for late-bound config).
Sourcepub async fn refresh_due(&self, now_ms: u64) -> Vec<String>
pub async fn refresh_due(&self, now_ms: u64) -> Vec<String>
Mint every provider-backed credential whose cached value is missing or within its refresh skew of expiry. Returns the ids (re)minted. Errors are logged and skipped so one failing provider doesn’t stall the others.
Trait Implementations§
Source§impl CredentialStore for CachingCredentials
impl CredentialStore for CachingCredentials
Auto Trait Implementations§
impl !Freeze for CachingCredentials
impl !RefUnwindSafe for CachingCredentials
impl !UnwindSafe for CachingCredentials
impl Send for CachingCredentials
impl Sync for CachingCredentials
impl Unpin for CachingCredentials
impl UnsafeUnpin for CachingCredentials
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