diff --git a/crates/iroha/src/lib.rs b/crates/iroha/src/lib.rs index 02c3553fb1..fe29f02d3f 100644 --- a/crates/iroha/src/lib.rs +++ b/crates/iroha/src/lib.rs @@ -5,7 +5,7 @@ pub mod config; pub mod http; mod http_default; pub mod query; -mod secrecy; +pub mod secrecy; pub use iroha_crypto as crypto; pub use iroha_data_model as data_model; diff --git a/crates/iroha/src/secrecy.rs b/crates/iroha/src/secrecy.rs index cdba906f47..ed6f5f1049 100644 --- a/crates/iroha/src/secrecy.rs +++ b/crates/iroha/src/secrecy.rs @@ -1,12 +1,15 @@ +//! Types for representing securely printable secrets. use std::fmt; use derive_more::Constructor; use serde::{Deserialize, Serialize, Serializer}; +/// SecretString epresents a sensitive secret string. #[derive(Clone, Deserialize, Constructor)] pub struct SecretString(String); impl SecretString { + /// Returns underlying secret string pub fn expose_secret(&self) -> &str { &self.0 }