#[repr(transparent)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ClientSecret(str);
impl ClientSecret {
#[cfg(feature = "rand")]
pub fn new() -> Box<Self> {
let id = uuid::Uuid::new_v4();
Self::from_owned(id.to_simple().to_string().into_boxed_str())
}
}
opaque_identifier_validated!(ClientSecret, ruma_identifiers_validation::client_secret::validate);
#[cfg(test)]
mod tests {
use std::convert::TryFrom;
use super::ClientSecret;
#[test]
fn valid_secret() {
assert!(<&ClientSecret>::try_from("this_=_a_valid_secret_1337").is_ok())
}
}