pub trait TokenSource:
Send
+ Sync
+ 'static {
// Required method
fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn format_header(&self, token: String) -> String { ... }
}Expand description
A source for authentication tokens.
Required Methods§
Provided Methods§
Sourcefn format_header(&self, token: String) -> String
fn format_header(&self, token: String) -> String
Formats the token for use in an Authorization header.
The default implementation formats the token as a Bearer token. Override this method if a different format is required.