annotate README.md @ 56:daa2cde64601

Big big refactor. Probably should have been multiple changes. - Makes FFI safer by explicitly specifying c_int in calls. - Uses ToPrimitive/FromPrimitive to make this easier. - Pulls PamFlag variables into a bitflags! struct. - Pulls PamMessageStyle variables into an enum. - Renames ResultCode to ErrorCode. - Switches from PAM_SUCCESS to using a Result<(), ErrorCode>. - Uses thiserror to make ErrorCode into an Error. - Gets rid of pam_try! because now we have Results. - Expands some names (e.g. Conv to Conversation). - Adds more doc comments. - Returns passwords as a SecureString, to avoid unnecessarily keeping it around in memory.
author Paul Fisher <paul@pfish.zone>
date Sun, 04 May 2025 02:56:55 -0400
parents ce47901aab7a
children 2a5c83d04b93
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
1 # 🍳 nonstick
16
f64ee7b6cdf1 Update metadata and README
Anthony Nowell <anthony@algorithmia.com>
parents:
diff changeset
2
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
3 Nonstick lets you use PAM (Pluggable Authentication Modules) from Rust without having to deal with icky unsafe code.
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
4
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
5 ## Status
16
f64ee7b6cdf1 Update metadata and README
Anthony Nowell <anthony@algorithmia.com>
parents:
diff changeset
6
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
7 It is currently very incomplete.
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
8 It only provides functionality for developing your own PAM authentication module (i.e., a backend that PAM calls to authenticate a user or do something similar).
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
9 At the moment, [Linux-PAM](https://github.com/linux-pam/linux-pam) is the only supported PAM implementation.
16
f64ee7b6cdf1 Update metadata and README
Anthony Nowell <anthony@algorithmia.com>
parents:
diff changeset
10
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
11 I will make an effort not to break APIs with development, but consider it alpha, pre-1.0 software.
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
12 While the code itself should be _secure_ and mostly safe, the API may not be completely stable.
17
53efbcff805d Add pam-sober
Anthony Nowell <anthony@algorithmia.com>
parents: 16
diff changeset
13
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
14 Goals include:
17
53efbcff805d Add pam-sober
Anthony Nowell <anthony@algorithmia.com>
parents: 16
diff changeset
15
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
16 - Bindings for PAM clients.
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
17 - Support for non–Linux-PAM implementations.
17
53efbcff805d Add pam-sober
Anthony Nowell <anthony@algorithmia.com>
parents: 16
diff changeset
18
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
19 ## Credits
16
f64ee7b6cdf1 Update metadata and README
Anthony Nowell <anthony@algorithmia.com>
parents:
diff changeset
20
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
21 This is a direct fork of [Anthony Nowell](http://anowell.com/)’s [`pam-rs`/`pam-bindings` crate](https://crates.io/crates/pam-bindings).
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
22 `pam-rs` was in turn inspired by:
16
f64ee7b6cdf1 Update metadata and README
Anthony Nowell <anthony@algorithmia.com>
parents:
diff changeset
23
45
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
24 - [`rust-pam` by tozny](https://github.com/tozny/rust-pam)
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
25 - [`pam_groupmap` by ndenev](https://github.com/ndenev/pam_groupmap)
ce47901aab7a Rename to “nonstick”, move to root, update docs and license.
Paul Fisher <paul@pfish.zone>
parents: 17
diff changeset
26 - [`pam-http` by beatgammit](https://github.com/beatgammit/pam-http)