Crates.io | passivized_htpasswd |
lib.rs | passivized_htpasswd |
version | 0.0.6 |
source | src |
created_at | 2022-10-17 03:11:42.586672 |
updated_at | 2024-01-07 04:23:52.800482 |
description | Generate htpasswd files |
homepage | |
repository | https://github.com/iamjpotts/passivized_htpasswd |
max_upload_size | |
id | 689765 |
size | 9,393 |
Generate htpasswd files with bcrypt passwords.
use std::error::Error;
use passivized_htpasswd::errors::HtpasswdError;
use passivized_htpasswd::Htpasswd;
fn setup_credentials() -> Result<(), Box<dyn Error>> {
let mut credentials = Htpasswd::new();
credentials.set("John Doe", "Don't hardcode")?;
credentials.write_to_path("www/.htpasswd")?;
Ok(())
}