Merge #893: config: redact RPC credentials in Config Debug impl.
5c3763526d4d2056e3b3dbf679e4c3244d1f4bf3 config: redact RPC credentials in Config Debug impl. (Antoine Poinsot)
Pull request description:
ACKs for top commit:
jp1ac4:
ACK 5c3763526d.
Tree-SHA512: 59d54913f25e5745a14ceac9012b5f285c06c3533709563c5dedeb0f0e3a548d7929f90ce698de004ae708deeb33f80061a233c64731fc9f7649d87df2119571
This commit is contained in:
commit
386b4cb3dd
@ -1,6 +1,6 @@
|
||||
use crate::descriptors::LianaDescriptor;
|
||||
|
||||
use std::{net::SocketAddr, path::PathBuf, str::FromStr, time::Duration};
|
||||
use std::{fmt, net::SocketAddr, path::PathBuf, str::FromStr, time::Duration};
|
||||
|
||||
use miniscript::bitcoin::Network;
|
||||
|
||||
@ -86,7 +86,7 @@ fn default_daemon() -> bool {
|
||||
}
|
||||
|
||||
/// RPC authentication options.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||
#[derive(Clone, PartialEq, Serialize)]
|
||||
pub enum BitcoindRpcAuth {
|
||||
/// Path to bitcoind's cookie file.
|
||||
#[serde(rename = "cookie_path")]
|
||||
@ -96,6 +96,15 @@ pub enum BitcoindRpcAuth {
|
||||
UserPass(String, String),
|
||||
}
|
||||
|
||||
impl fmt::Debug for BitcoindRpcAuth {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::CookieFile(path) => path.fmt(f),
|
||||
Self::UserPass(_, _) => write!(f, "REDACTED RPC CREDENTIALS"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Everything we need to know for talking to bitcoind serenely
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct BitcoindConfig {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user