Crate passivized_htpasswd

Source
Expand description

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

Modules§

errors

Structs§

Htpasswd

Enums§

Algo
Hashing algorithms understood by this library. Does not yet include all algorithms that may present in an htpasswd file or understood by tools that use its file format.