ezidam: apps: view, update, new secret

This commit is contained in:
Philippe Loctaux 2023-04-02 00:52:16 +02:00
parent 4b99905ee0
commit 2caf584cb7
12 changed files with 407 additions and 9 deletions

View file

@ -2,6 +2,7 @@ use crate::error::Error;
use crate::hash::{hash, Hash};
use nanoid::nanoid;
use nanoid_dictionary::ALPHANUMERIC;
use std::fmt::{Display, Formatter};
// Struct to generate the secret
pub struct SecretString(String);
@ -20,6 +21,11 @@ impl AsRef<str> for SecretString {
self.0.as_ref()
}
}
impl Display for SecretString {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
#[derive(Debug)]
pub struct Secret(Hash);