Skip to content

Commit

Permalink
fixup! Fixes #23159: Use the secrecy crates for wrapping passwords
Browse files Browse the repository at this point in the history
Fixes #23159: Use the secrecy crates for wrapping passwords
  • Loading branch information
amousset committed Jul 30, 2023
1 parent b888524 commit 7c2457e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions relay/sources/relayd/benches/benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ 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::{
schema::{reportsexecution::dsl::*, ruddersysevents::dsl::*},
*,
},
};
use secrecy::SecretString;

fn bench_nodeslist(c: &mut Criterion) {
c.bench_function("parse nodes list", move |b| {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions relay/sources/relayd/src/output/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ pub fn insert_runlog(pool: &PgPool, runlog: &RunLog) -> Result<RunlogInsertion,
#[cfg(test)]
mod tests {
use diesel::dsl::count;
use secrecy::SecretString;

use super::*;
use crate::{
configuration::Secret,
data::report::QueryableReport,
output::database::schema::{reportsexecution::dsl::*, ruddersysevents::dsl::*},
};

pub fn db() -> 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()
Expand Down

0 comments on commit 7c2457e

Please sign in to comment.