diff src/libpam/module.rs @ 146:1bc52025156b

Split PAM items into their own separate struct. To trim down the number of methods on `PamShared`, this puts all the Items into their own struct(s). This also makes the split between authtok/authtok_item easier to understand.
author Paul Fisher <paul@pfish.zone>
date Sun, 06 Jul 2025 19:10:26 -0400
parents 56b559b7ecea
children
line wrap: on
line diff
--- a/src/libpam/module.rs	Sun Jul 06 19:04:57 2025 -0400
+++ b/src/libpam/module.rs	Sun Jul 06 19:10:26 2025 -0400
@@ -11,7 +11,7 @@
 ///
 /// ```no_run
 /// use nonstick::{
-///     pam_hooks, ConversationAdapter, Flags, LibPamTransaction, PamHandleModule, PamModule,
+///     pam_hooks, ConversationAdapter, Flags, LibPamTransaction, ModuleClient, PamModule,
 ///     Result as PamResult,
 /// };
 /// use std::ffi::CStr;
@@ -20,7 +20,7 @@
 /// struct MyPamModule;
 /// pam_hooks!(MyPamModule);
 ///
-/// impl<T: PamHandleModule> PamModule<T> for MyPamModule {
+/// impl<T: ModuleClient> PamModule<T> for MyPamModule {
 ///     fn authenticate(handle: &mut T, args: Vec<&CStr>, flags: Flags) -> PamResult<()> {
 ///         let password = handle.authtok(Some("what's your password?".as_ref()))?;
 ///         let response =
@@ -151,9 +151,9 @@
 #[cfg(test)]
 mod tests {
     // Compile-time test that the `pam_hooks` macro compiles.
-    use crate::{PamHandleModule, PamModule};
+    use crate::{ModuleClient, PamModule};
     struct Foo;
-    impl<T: PamHandleModule> PamModule<T> for Foo {}
+    impl<T: ModuleClient> PamModule<T> for Foo {}
 
     pam_hooks!(Foo);
 }