diff --git a/proxy/src/compute.rs b/proxy/src/compute.rs index 7c0ab965a0..3c0eee29bc 100644 --- a/proxy/src/compute.rs +++ b/proxy/src/compute.rs @@ -24,7 +24,7 @@ pub enum ConnectionError { impl UserFacingError for ConnectionError {} /// Compute node connection params. -#[derive(Serialize, Deserialize, Debug, Default)] +#[derive(Serialize, Deserialize, Default)] pub struct DatabaseInfo { pub host: String, pub port: u16, @@ -33,6 +33,16 @@ pub struct DatabaseInfo { pub password: Option, } +// Manually implement debug to omit personal and sensitive info +impl std::fmt::Debug for DatabaseInfo { + fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { + fmt.debug_struct("DatabaseInfo") + .field("host", &self.host) + .field("port", &self.port) + .finish() + } +} + /// PostgreSQL version as [`String`]. pub type Version = String; diff --git a/proxy/src/mgmt.rs b/proxy/src/mgmt.rs index e53542dfd2..ab6fdff040 100644 --- a/proxy/src/mgmt.rs +++ b/proxy/src/mgmt.rs @@ -107,7 +107,7 @@ impl postgres_backend::Handler for MgmtHandler { } fn try_process_query(pgb: &mut PostgresBackend, query_string: &str) -> anyhow::Result<()> { - println!("Got mgmt query: '{}'", query_string); + println!("Got mgmt query [redacted]"); // Content contains password, don't print it let resp: PsqlSessionResponse = serde_json::from_str(query_string)?;