pub trait TokenSource: Send + Sync {
// Required method
fn token(&self) -> BoxFuture<'_, Result<String>>;
// Provided method
fn invalidate(&self) { ... }
}Expand description
Returns a Chainguard bearer token whose audience includes DEFAULT_AUDIENCE (or, for the
platform API, PLATFORM_AUDIENCE).
Implement it with a function through token_fn. Caching sources also implement
invalidate: the client calls it when the plane answers
Unauthenticated, so the next call fetches a fresh token.
Required Methods§
Provided Methods§
Sourcefn invalidate(&self)
fn invalidate(&self)
Forgets a cached token. The default does nothing.