Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make SecretString public #5269

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/iroha/src/lib.rs
aoyako marked this conversation as resolved.
Show resolved Hide resolved
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
Loading