feat(admin): create and list users commands

This commit is contained in:
Matthieu Bessat 2024-12-03 13:20:33 +01:00
parent 8d20cab18f
commit a0de3b287b
19 changed files with 314 additions and 30 deletions

View file

@ -43,6 +43,18 @@ pub fn get_random_alphanumerical(length: usize) -> String {
.collect()
}
/// Generate easy to type token
pub fn get_random_human_token() -> String {
return format!(
"{}-{}-{}-{}-{}",
get_random_alphanumerical(4),
get_random_alphanumerical(4),
get_random_alphanumerical(4),
get_random_alphanumerical(4),
get_random_alphanumerical(4)
).to_uppercase();
}
pub fn parse_basic_auth(header_value: &str) -> Result<(String, String)> {
let header_val_components: Vec<&str> = header_value.split(" ").collect();
let encoded_header_value: &str = header_val_components