pub trait KeyAuth: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn has_login(&self) -> bool;
fn login<'a>(
&'a self,
interaction: &'a Interaction,
) -> BoxFuture<'a, Result<ApiKeyCredential, AuthError>>;
fn resolve<'a>(
&'a self,
credential: Option<&'a ApiKeyCredential>,
) -> BoxFuture<'a, Result<Option<Resolved>, String>>;
}Expand description
pi-ai’s ApiKeyAuth of a provider an extension implements.
Required Methods§
Sourcefn has_login(&self) -> bool
fn has_login(&self) -> bool
Whether KeyAuth::login asks for the credential. Without it the
key is set up outside yapi.
Sourcefn login<'a>(
&'a self,
interaction: &'a Interaction,
) -> BoxFuture<'a, Result<ApiKeyCredential, AuthError>>
fn login<'a>( &'a self, interaction: &'a Interaction, ) -> BoxFuture<'a, Result<ApiKeyCredential, AuthError>>
Asks for the credential to store through interaction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".