Stop logging viewing keys in the config (#8064)
This commit is contained in:
parent
9fec7116ca
commit
e692b943d2
|
@ -1,5 +1,7 @@
|
||||||
//! Configuration for blockchain scanning tasks.
|
//! Configuration for blockchain scanning tasks.
|
||||||
|
|
||||||
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -7,7 +9,7 @@ use zebra_state::Config as DbConfig;
|
||||||
|
|
||||||
use crate::storage::SaplingScanningKey;
|
use crate::storage::SaplingScanningKey;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize)]
|
||||||
#[serde(deny_unknown_fields, default)]
|
#[serde(deny_unknown_fields, default)]
|
||||||
/// Configuration for scanning.
|
/// Configuration for scanning.
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
@ -25,6 +27,16 @@ pub struct Config {
|
||||||
db_config: DbConfig,
|
db_config: DbConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for Config {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_struct("Config")
|
||||||
|
// Security: don't log private keys, birthday heights might also be private
|
||||||
|
.field("sapling_keys_to_scan", &self.sapling_keys_to_scan.len())
|
||||||
|
.field("db_config", &self.db_config)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in New Issue