pub trait AuthProvider:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &str;
fn get_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
env: &'life1 str,
command: &'life2 str,
tier: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn logout<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_environments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn get_credential_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Named auth provider used by middleware and transport injectors.
Implementations own their credential cache strategy. The framework only
routes calls and passes command context (env, colon command path, and tier).
Required Methods§
Sourcefn get_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
env: &'life1 str,
command: &'life2 str,
tier: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_credential<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
env: &'life1 str,
command: &'life2 str,
tier: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Returns a credential for env, command, and tier.
Sourcefn status<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
env: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns cached credential status for one environment.
Provided Methods§
Sourcefn get_credential_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_credential_for<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Credential>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns a credential for a command, given its full CredentialRequest.
The default implementation ignores the metadata and delegates to
get_credential. Providers that act on
command metadata — such as an OAuth provider performing scope step-up
from CommandMeta::scopes — override this. The framework calls this
method (not get_credential) when resolving credentials, so an override
receives the command’s metadata.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".