Trait scylla::authentication::AuthenticatorProvider

source ·
pub trait AuthenticatorProvider: Sync + Send {
    // Required method
    fn start_authentication_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        authenticator_name: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(Option<Vec<u8>>, Box<dyn AuthenticatorSession>), AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait used to represent a factory of AuthenticatorSession instances. A new AuthenticatorSession instance will be created for each session.

The custom authenticator can be set using SessionBuilder::authenticator_provider method.

Default: PlainTextAuthenticator is the default authenticator which requires username and password. It can be set by using SessionBuilder::user("user", "pass") method.

Required Methods§

source

fn start_authentication_session<'life0, 'life1, 'async_trait>( &'life0 self, authenticator_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(Option<Vec<u8>>, Box<dyn AuthenticatorSession>), AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

A pair of initial response and boxed AuthenticatorSession should be returned if authentication is required by the server.

Implementors§