Skip to content

Commit 917fa71

Browse files
committed
add censoring to reducer args sent to other clients than the callee
1 parent 14ba750 commit 917fa71

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

crates/core/src/subscription/module_subscription_manager.rs

+16
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::client::{ClientConnectionSender, Protocol};
88
use crate::error::DBError;
99
use crate::execution_context::WorkloadType;
1010
use crate::host::module_host::{DatabaseTableUpdate, ModuleEvent, UpdatesRelValue};
11+
use crate::host::ArgsTuple;
1112
use crate::messages::websocket::{self as ws, TableUpdate};
1213
use crate::subscription::delta::eval_delta;
1314
use crate::subscription::record_exec_metrics;
@@ -998,6 +999,21 @@ impl SubscriptionManager {
998999
send_to_client(caller, message);
9991000
}
10001001

1002+
// Censor Reducer args
1003+
let mut event = ModuleEvent {
1004+
timestamp: event.timestamp,
1005+
caller_identity: event.caller_identity,
1006+
caller_connection_id: event.caller_connection_id,
1007+
function_call: event.function_call.clone(),
1008+
status: event.status.clone(),
1009+
energy_quanta_used: event.energy_quanta_used,
1010+
host_execution_duration: event.host_execution_duration,
1011+
request_id: event.request_id,
1012+
timer: event.timer,
1013+
};
1014+
event.function_call.args = ArgsTuple::nullary();
1015+
let event = Arc::new(event);
1016+
10011017
// Send all the other updates.
10021018
for (id, update) in eval {
10031019
let database_update = SubscriptionUpdateMessage::from_event_and_update(&event, update);

0 commit comments

Comments
 (0)