Skip to content

Commit

Permalink
Merge pull request #286 from stakwork/test/create-password-hash
Browse files Browse the repository at this point in the history
feat: test file to generate password and it hash
  • Loading branch information
tobi-bams authored Sep 10, 2024
2 parents 8927b0e + ba1edba commit 4b5bf0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,16 @@ pub fn env_no_empty(varname: &str) -> Option<String> {
None => None,
}
}

#[cfg(test)]
mod tests {

#[test]
fn create_password_and_password_hash() {
let password = crate::secrets::hex_secret_32();
println!("Logging Password: {}", password);
let hashed_password =
bcrypt::hash(&password, bcrypt::DEFAULT_COST).expect("failed to bcrypt");
println!("Hashed Password: {}", hashed_password);
}
}

0 comments on commit 4b5bf0a

Please sign in to comment.