Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(web3): redact recovery phrase from debug output

Steven Enamakel64372b7f0037
diff --git a/crates/openhuman-core/src/web3/wallet/ops/types.rs b/crates/openhuman-core/src/web3/wallet/ops/types.rs
index 1839b415d1..7d8c4712f4 100644
--- a/crates/openhuman-core/src/web3/wallet/ops/types.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops/types.rs
@@ -51,13 +51,22 @@ impl std::fmt::Debug for WalletRecoveryMaterial {
}
/// Generated recovery phrase returned for encryption and user confirmation.
-#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[derive(Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct GeneratedRecoveryPhrase {
pub phrase: String,
pub word_count: u8,
}
+impl std::fmt::Debug for GeneratedRecoveryPhrase {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("GeneratedRecoveryPhrase")
+ .field("phrase", &"<redacted>")
+ .field("word_count", &self.word_count)
+ .finish()
+ }
+}
+
/// Result of checking a recovery phrase with TinyWallet.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct RecoveryPhraseValidation {