Skip to main content

CredentialRefresher

Trait CredentialRefresher 

Source
pub trait CredentialRefresher: Send + Sync {
    // Required method
    fn refresh<'life0, 'life1, 'async_trait>(
        &'life0 self,
        req: RefreshRequest<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<Refreshed, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

How a credential too close to expiry is renewed.

A seam, and deliberately a narrow one. Renewing means speaking OAuth to an authorization server — discovery, a client registration, a token endpoint — and this runtime holds no opinion about protocols: it knows only that a stored value carries an expiry and an issuer, and that something outside can turn those into a fresh value. act-cli implements it over act:credentials’ OAuth flow; an embedder with a different upstream implements it differently, or passes none and gets no renewal.

Nothing here mentions OAuth for that reason. What crosses is what any renewal must produce.

Required Methods§

Source

fn refresh<'life0, 'life1, 'async_trait>( &'life0 self, req: RefreshRequest<'life1>, ) -> Pin<Box<dyn Future<Output = Result<Refreshed, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Renew one credential. The error is a diagnostic for the host’s log — it reaches no component, and MUST NOT carry credential material.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§