Skip to main content

run_generate_api_key_command

Function run_generate_api_key_command 

Source
pub fn run_generate_api_key_command(prefix: &str) -> Result<(), Box<dyn Error>>
Expand description

Generate a new API key and corresponding hash for secure storage.

Prints the plain-text key once for the operator to copy, along with the stable key ID and the Argon2 PHC hash that should be stored in config or secret storage.

ยงErrors

Returns an error if key generation fails or if the prefix is invalid.