Skip to main content

Transaction

Trait Transaction 

Source
pub trait Transaction: PamShared {
    // Required methods
    fn authenticate(&mut self, flags: AuthnFlags) -> Result<()>;
    fn account_management(&mut self, flags: AuthnFlags) -> Result<()>;
    fn change_authtok(&mut self, flags: AuthtokFlags) -> Result<()>;
}
Expand description

Functionality of a PAM handle that can be expected by a PAM application.

If you are not writing a PAM client application (e.g., you are writing a module), you should not use the functionality exposed by this trait.

Like PamShared, this is intended to allow creating mock implementations of PAM for testing PAM applications.

Required Methods§

Source

fn authenticate(&mut self, flags: AuthnFlags) -> Result<()>

Starts the authentication process for the user.

The application calls this to find out who the user is, and verify that they are really that person. If authentication is successful, this will return an Ok(()) Result.

A PAM module may change the caller’s username as part of the login process, so be sure to check it after making any PAM application call.

§References
Source

fn account_management(&mut self, flags: AuthnFlags) -> Result<()>

Verifies the validity of the user’s account (and other stuff).

After authentication, an application should call this to ensure that the user’s account is still valid. This may check for token expiration or that the user’s account is not locked.

§References
Source

fn change_authtok(&mut self, flags: AuthtokFlags) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§