Skip to main content

AuthSource

Trait AuthSource 

Source
pub trait AuthSource:
    Send
    + Sync
    + Debug {
    // Required method
    fn get_password<'life0, 'life1, 'async_trait>(
        &'life0 self,
        login: &'life1 LoginInfo<'_>,
    ) -> Pin<Box<dyn Future<Output = PgWireResult<Password>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Represents auth source, the source returns password either in cleartext or hashed with salt.

When using with different authentication mechanism, the developer can choose specific implementation of AuthSource. For example, with cleartext authentication, salt is not required, while in md5pass, a 4-byte salt is needed.

Required Methods§

Source

fn get_password<'life0, 'life1, 'async_trait>( &'life0 self, login: &'life1 LoginInfo<'_>, ) -> Pin<Box<dyn Future<Output = PgWireResult<Password>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get password from the AuthSource.

Password has a an optional salt field when it’s hashed.

Implementors§