From 7c2457ec2b06bddeec96580637e1fe3775ecd9b2 Mon Sep 17 00:00:00 2001 From: Alexis Mousset Date: Sun, 30 Jul 2023 21:02:08 +0200 Subject: [PATCH] fixup! Fixes #23159: Use the secrecy crates for wrapping passwords Fixes #23159: Use the secrecy crates for wrapping passwords --- relay/sources/relayd/benches/benches.rs | 5 +++-- relay/sources/relayd/src/output/database.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/relay/sources/relayd/benches/benches.rs b/relay/sources/relayd/benches/benches.rs index a618d5f643f..4dade892bc7 100644 --- a/relay/sources/relayd/benches/benches.rs +++ b/relay/sources/relayd/benches/benches.rs @@ -13,7 +13,7 @@ use diesel::{self, prelude::*}; use flate2::read::GzDecoder; use openssl::{stack::Stack, x509::X509}; use rudder_relayd::{ - configuration::{main::DatabaseConfig, Secret}, + configuration::main::DatabaseConfig, data::{node::NodesList, report::QueryableReport, RunInfo, RunLog}, input::signature, output::database::{ @@ -21,6 +21,7 @@ use rudder_relayd::{ *, }, }; +use secrecy::SecretString; fn bench_nodeslist(c: &mut Criterion) { c.bench_function("parse nodes list", move |b| { @@ -97,7 +98,7 @@ fn bench_uncompress_runlog(c: &mut Criterion) { pub fn db() -> PgPool { let db_config = DatabaseConfig { url: "postgres://rudderreports@127.0.0.1/rudder".to_string(), - password: Secret::new("PASSWORD".to_string()), + password: SecretString::new("PASSWORD".to_string()), max_pool_size: 10, }; pg_pool(&db_config).unwrap() diff --git a/relay/sources/relayd/src/output/database.rs b/relay/sources/relayd/src/output/database.rs index 3b9da231c1d..01268783ca9 100644 --- a/relay/sources/relayd/src/output/database.rs +++ b/relay/sources/relayd/src/output/database.rs @@ -167,10 +167,10 @@ pub fn insert_runlog(pool: &PgPool, runlog: &RunLog) -> Result PgPool { let db_config = DatabaseConfig { url: "postgres://rudderreports:@postgres/rudder".to_string(), - password: Secret::new("PASSWORD".to_string()), + password: SecretString::new("PASSWORD".to_string()), max_pool_size: 5, }; pg_pool(&db_config).unwrap()