Crates.io | pam-f |
lib.rs | pam-f |
version | |
source | src |
created_at | 2024-12-04 11:13:38.733453 |
updated_at | 2024-12-04 11:18:56.789794 |
description | Safe Rust wrappers for PAM authentication |
homepage | |
repository | https://github.com/Decodertalkers/pam/ |
max_upload_size | |
id | 1471860 |
Cargo.toml error: | TOML parse error at line 28, column 1 | 28 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Note: Currently only supports basic username/password authentication out-of-the-box.
Environment support through the env
module is probably broken and should not be used in the current state!
pam
to your Cargo.toml:[dependencies]
pam = { package = "pam-f", version = "0.8.1" }
Authenticator
struct to authenticate and open a sessionpub fn main() {
let service = "<yourapp>";
let user = "<user>";
let password = "<pass>";
let mut auth = pam::Authenticator::with_password(service).unwrap();
auth.handler_mut().set_credentials(user, password);
if auth.authenticate().is_ok() && auth.open_session().is_ok() {
println!("Successfully opened a session!");
}
else {
println!("Authentication failed =/");
}
}
Implement basic user/password authentication
Add Authenticator
struct
Add (more) documentation
Verify current conv
does not leak memory
Allow custom conv
functions to be passed
Code cleanup
The library is only continuously built against Rust stable, beta and nightly but as it does not use a lot of new language features it should probably compile on older versions as well. If you encounter problems building on older versions and a small fix can be applied to make the build succeed, consider opening a pull request.
This crate follows semantic versioning. As such all versions below 1.0.0
should be
considered development versions. This means the API could change any time.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.