pub struct DefaultCredentialResolver { /* private fields */ }Expand description
Default credential resolver that handles:
- API key passthrough
- Bearer token expiry validation
- OAuth2 token refresh with deduplication
Implementations§
Source§impl DefaultCredentialResolver
impl DefaultCredentialResolver
Sourcepub fn new(store: Arc<dyn CredentialStore>) -> Self
pub fn new(store: Arc<dyn CredentialStore>) -> Self
Create a resolver backed by the given credential store.
Sourcepub fn with_client(self, client: Client) -> Self
pub fn with_client(self, client: Client) -> Self
Set a custom HTTP client for OAuth2 refresh requests.
Sourcepub fn with_expiry_buffer(self, buffer: Duration) -> Self
pub fn with_expiry_buffer(self, buffer: Duration) -> Self
Set the expiry buffer (default: 60 seconds).
Tokens expiring within this duration are treated as expired.
Trait Implementations§
Source§impl CredentialResolver for DefaultCredentialResolver
impl CredentialResolver for DefaultCredentialResolver
Source§fn resolve(&self, key: &str) -> CredentialFuture<'_, ResolvedCredential>
fn resolve(&self, key: &str) -> CredentialFuture<'_, ResolvedCredential>
Resolve a credential by key. Returns the minimal secret value
needed for the authenticated request.
Auto Trait Implementations§
impl !Freeze for DefaultCredentialResolver
impl !RefUnwindSafe for DefaultCredentialResolver
impl Send for DefaultCredentialResolver
impl Sync for DefaultCredentialResolver
impl Unpin for DefaultCredentialResolver
impl UnsafeUnpin for DefaultCredentialResolver
impl !UnwindSafe for DefaultCredentialResolver
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