Skip to content

Commit

Permalink
feat(plumber): allow root to access deactivated workers [fixes NET-695]…
Browse files Browse the repository at this point in the history
… (#1968)

* allow root to access deactivated workers
  • Loading branch information
kmd-fl committed Dec 19, 2023
1 parent fe706a0 commit 2d13c8a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions aquamarine/src/plumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ impl<RT: AquaRuntime, F: ParticleFunctionStatic> Plumber<RT, F> {
return;
}

if !self.key_manager.is_worker_active(worker_id)
&& !self
.key_manager
.is_management(particle.particle.init_peer_id)
{
let is_active = self.key_manager.is_worker_active(worker_id);
let is_manager = self
.key_manager
.is_management(particle.particle.init_peer_id);
let is_host = self.key_manager.is_host(particle.particle.init_peer_id);

// Only a manager or the host itself is allowed to access deactivated workers
if !is_active && !is_manager && !is_host {
tracing::trace!(target: "worker_inactive", particle_id = particle.particle.id, worker_id = worker_id.to_string(), "Worker is not active");
return;
}
Expand Down

0 comments on commit 2d13c8a

Please sign in to comment.