Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vibi-dpu/src/core/trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct TriggerReview {
pub async fn process_trigger(message_data: &Vec<u8>) {
// parse message
let parse_res = parse_trigger_msg(message_data);
log::debug!("[process_trigger] parse_res = {:?}", &parse_res);
// create review object from db
if parse_res.is_none() {
log::error!("[process_trigger] Unable to parse message: {:?}", &message_data);
Expand Down
1 change: 1 addition & 0 deletions vibi-dpu/src/graph/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ pub fn absolute_to_relative_path(abs_path: &str, review: &Review) -> Option<Stri
return None;
}
let rel_path = rel_path_res.expect("Uncaught error in rel_path_res");
log::debug!("[absolute_to_relative_path] rel_path = {:?}", rel_path);
return Some(rel_path.to_str().expect("Unable to deserialze rel_path").to_string());
}

Expand Down
4 changes: 4 additions & 0 deletions vibi-dpu/src/pubsub/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async fn process_message(attributes: &HashMap<String, String>, data_bytes: &Vec<
return;
}
let msgtype = msgtype_opt.expect("Empty msgtype");
log::debug!("[process_message] msgtype = {:?}", msgtype);
match msgtype.as_str() {
"install_callback" => {
process_install_callback(&data_bytes).await;
Expand All @@ -52,6 +53,7 @@ async fn process_message(attributes: &HashMap<String, String>, data_bytes: &Vec<
}
"manual_trigger" => {
log::info!("Processing trigger...");
log::debug!("[process_message] data_bytes = {:?}", &data_bytes);
process_trigger(&data_bytes).await;
log::info!("Trigger task processed!");
}
Expand All @@ -64,6 +66,7 @@ async fn process_message(attributes: &HashMap<String, String>, data_bytes: &Vec<
log::error!("[process_message] Message type not found for message : {:?}", attributes);
}
};
log::debug!("[process_message] msgtype.as_str() = {:?}", msgtype.as_str());
}

async fn process_install_callback(data_bytes: &[u8]) {
Expand Down Expand Up @@ -151,6 +154,7 @@ pub async fn listen_messages(keypath: &str, topicname: &str) {
log::info!("Recieved task, processing...");
let attrmap: HashMap<String, String> =
message.message.attributes.clone().into_iter().collect();
log::debug!("[listen_messages] attrmap = {:?}", &attrmap);
let message_hash = digest(&*message.message.data);
Comment on lines +157 to 158
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Sanitize logged message attributes
Dumping the entire attrmap risks leaking sensitive attributes (tokens, personal data, etc.). Consider filtering or redacting sensitive keys before logging, or restrict this detailed debug output to non-production environments.

if !message_hashes.contains(&message_hash) {
message_hashes.push_back(message_hash);
Expand Down