Trait scram_tmp::server::AuthenticationProvider[][src]

pub trait AuthenticationProvider {
    fn get_password_for(&self, username: &str) -> Option<PasswordInfo>;

    fn authorize(&self, authcid: &str, authzid: &str) -> bool { ... }
}

An AuthenticationProvider looks up password information for a given user, and also checks if a user is authorized to act on another user's behalf. The authorization component is optional, and if not implemented will simply allow users to act on their own behalf, and no one else's.

To ensure the password is hashed correctly, cleartext passwords can be hased using the hash_password() function provided in the crate root.

Required Methods

Gets the PasswordInfo for the given user.

Provided Methods

Checks to see if the user given by authcid is authorized to act as the user given by authzid. Implementors do not need to implement this method. The default implementation just checks if the two are equal

Implementors