Mercurial > crates > nonstick
comparison src/handle.rs @ 144:56b559b7ecea
Big rename: separate concepts of Transaction from Handle.
- An application that uses PAM creates a Transaction.
- The Transaction has a Handle.
Currently, a module still get something called a "handle",
but that's probably going to change soon.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Sun, 06 Jul 2025 11:59:26 -0400 |
| parents | ebb71a412b58 |
| children | 1bc52025156b |
comparison
equal
deleted
inserted
replaced
| 143:ebb71a412b58 | 144:56b559b7ecea |
|---|---|
| 57 /// Functionality for both PAM applications and PAM modules. | 57 /// Functionality for both PAM applications and PAM modules. |
| 58 /// | 58 /// |
| 59 /// This base trait includes features of a PAM handle that are available | 59 /// This base trait includes features of a PAM handle that are available |
| 60 /// to both applications and modules. | 60 /// to both applications and modules. |
| 61 /// | 61 /// |
| 62 /// You probably want [`LibPamHandle`](crate::libpam::OwnedLibPamHandle). | 62 /// You probably want [`LibPamTransaction`](crate::libpam::LibPamTransaction). |
| 63 /// This trait is intended to allow creating mock PAM handle types | 63 /// This trait is intended to allow creating mock PAM handle types |
| 64 /// to test PAM modules and applications. | 64 /// to test PAM modules and applications. |
| 65 pub trait PamShared { | 65 pub trait PamShared { |
| 66 /// Logs something via this PAM handle. | 66 /// Logs something via this PAM handle. |
| 67 /// | 67 /// |
| 266 /// If you are not writing a PAM client application (e.g., you are writing | 266 /// If you are not writing a PAM client application (e.g., you are writing |
| 267 /// a module), you should not use the functionality exposed by this trait. | 267 /// a module), you should not use the functionality exposed by this trait. |
| 268 /// | 268 /// |
| 269 /// Like [`PamShared`], this is intended to allow creating mock implementations | 269 /// Like [`PamShared`], this is intended to allow creating mock implementations |
| 270 /// of PAM for testing PAM applications. | 270 /// of PAM for testing PAM applications. |
| 271 pub trait PamHandleApplication: PamShared { | 271 pub trait Transaction: PamShared { |
| 272 /// Starts the authentication process for the user. | 272 /// Starts the authentication process for the user. |
| 273 /// | 273 /// |
| 274 /// The application calls this to find out who the user is, and verify that | 274 /// The application calls this to find out who the user is, and verify that |
| 275 /// they are really that person. If authentication is successful, | 275 /// they are really that person. If authentication is successful, |
| 276 /// this will return an `Ok(())` [`Result`]. | 276 /// this will return an `Ok(())` [`Result`]. |
