Skip to content

Commit

Permalink
fix: Make SecretString public (#5269)
Browse files Browse the repository at this point in the history
* fix: make secret string public

Signed-off-by: Lohachov Mykhailo <[email protected]>

* fix: Update crates/iroha/src/secrecy.rs

Co-authored-by: Shunkichi Sato <[email protected]>
Signed-off-by: Mykhailo Lohachov <[email protected]>

---------

Signed-off-by: Lohachov Mykhailo <[email protected]>
Signed-off-by: Mykhailo Lohachov <[email protected]>
Co-authored-by: Shunkichi Sato <[email protected]>
  • Loading branch information
aoyako and s8sato authored Dec 12, 2024
1 parent f32a775 commit d512102
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/iroha/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions crates/iroha/src/secrecy.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
//! Types for representing securely printable secrets.
use std::fmt;

use derive_more::Constructor;
use serde::{Deserialize, Serialize, Serializer};

/// String sensitive to printing and serialization
#[derive(Clone, Deserialize, Constructor)]
pub struct SecretString(String);

impl SecretString {
/// Returns underlying secret string
pub fn expose_secret(&self) -> &str {
&self.0
}
Expand Down

0 comments on commit d512102

Please sign in to comment.