Skip to main content

generate_temp_password

Function generate_temp_password 

Source
pub fn generate_temp_password(len: usize) -> String
Expand description

Generate an alphanumeric temp password of len characters. The alphabet excludes visually ambiguous glyphs (0/O, 1/l/I) so an operator reading the password aloud or writing it down by hand has fewer transcription errors. Used by rustio-admin user reset-password when --temp-password is not supplied.

The generated value is NOT stored anywhere by this function — the caller passes it through reset_password which Argon2- hashes it for rustio_users.password_hash and then prints the plaintext exactly once.