5 releases

0.0.6 Jan 7, 2024
0.0.5 Aug 31, 2023
0.0.3 Dec 4, 2022
0.0.2 Oct 17, 2022
0.0.1 Oct 17, 2022

#217 in Authentication

Download history 2/week @ 2023-12-16 4/week @ 2023-12-23 2/week @ 2023-12-30 16/week @ 2024-01-06 15/week @ 2024-01-13 71/week @ 2024-02-17 28/week @ 2024-02-24 16/week @ 2024-03-02 8/week @ 2024-03-09 2/week @ 2024-03-16

63 downloads per month
Used in 2 crates

MPL-2.0 license

10KB
178 lines

Generate htpasswd files with bcrypt passwords.

Example

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(())
}

lib.rs:

Generate Apache .htpasswd files using bcrypt.

Example

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(())
}

Dependencies

~3.5MB
~62K SLoC