fix(server): don't log usernames to log file, I guess
This commit is contained in:
parent
520c8f0dbf
commit
0b9b935334
|
|
@ -70,7 +70,9 @@ async fn main() -> Result<()> {
|
||||||
let ingester = BatchIngester::new(db, queue_service, file_service, config);
|
let ingester = BatchIngester::new(db, queue_service, file_service, config);
|
||||||
|
|
||||||
println!("Starting batch ingestion from: {}", directory);
|
println!("Starting batch ingestion from: {}", directory);
|
||||||
println!("User ID: {}", user_id);
|
// Only show the first and last character of the user ID
|
||||||
|
let masked_user_id = format!("{}{}", &user_id.to_string()[..1], &user_id.to_string()[user_id.to_string().len() - 1..]);
|
||||||
|
println!("User ID: {}", masked_user_id);
|
||||||
|
|
||||||
// Start ingestion
|
// Start ingestion
|
||||||
if let Err(e) = ingester.ingest_directory(dir_path, user_id).await {
|
if let Err(e) = ingester.ingest_directory(dir_path, user_id).await {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,9 @@ impl Config {
|
||||||
let credentials = &credentials_part[username_start + 3..];
|
let credentials = &credentials_part[username_start + 3..];
|
||||||
if let Some(colon_pos) = credentials.find(':') {
|
if let Some(colon_pos) = credentials.find(':') {
|
||||||
let username = &credentials[..colon_pos];
|
let username = &credentials[..colon_pos];
|
||||||
format!("{}{}:***@{}", protocol, username, remaining_part)
|
// Show first and last character of the username
|
||||||
|
let masked_username = format!("{}{}", &username[..1], &username[username.len() - 1..]);
|
||||||
|
format!("{}{}:***@{}", protocol, masked_username, remaining_part)
|
||||||
} else {
|
} else {
|
||||||
format!("{}***@{}", protocol, remaining_part)
|
format!("{}***@{}", protocol, remaining_part)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,10 @@ async fn main() -> anyhow::Result<()> {
|
||||||
} else {
|
} else {
|
||||||
"unknown"
|
"unknown"
|
||||||
};
|
};
|
||||||
|
// if we get the username, let's now mask it to get just the first and last character
|
||||||
|
let masked_username = format!("{}{}", &username[..1], &username[username.len() - 1..]);
|
||||||
|
|
||||||
format!("{}://{}:***@{}", protocol, username, host_part)
|
format!("{}://{}:***@{}", protocol, masked_username, host_part)
|
||||||
} else {
|
} else {
|
||||||
"Invalid database URL format".to_string()
|
"Invalid database URL format".to_string()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue