Skip to main content

AuthRefresh

Trait AuthRefresh 

Source
pub trait AuthRefresh: Send + Sync {
    // Required method
    fn refresh(&self) -> Option<AuthScheme>;
}
Expand description

Re-resolve the credential after a 401/403 (plan §4.5).

Returns Some(new) iff a different credential was obtained — grok’s refresh_after_unauthorized only fires on a changed token. v0 is static-key, so the default provider carries no refresher and a 401 is terminal immediately; this seam is what a future OAuth flow plugs into.

Required Methods§

Source

fn refresh(&self) -> Option<AuthScheme>

Produce a fresh credential, or None if nothing new is available.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§