Watch
0
0
Fork
You've already forked hyperhive
0

swarm-wire: take agent_limits's wire types

This commit is contained in:
atlas 2026-10-18 12:29:18 +02:00 • committed by mara
commit 9cce9c470f
11 changed files with 122 additions and 115 deletions

View file

@ -566,7 +566,7 @@ impl Policy {
format!("$KV.{}.{hive}.*", swarm_wire::agent_status::BUCKET),
]);
// Reading the caps the swarm sets for the agents this hive runs
// (`swarm_queue_client::agent_limits`): a direct get, so read-only, and
// (`swarm_wire::agent_limits`): a direct get, so read-only, and
// no `STREAM.INFO` because the reader skips the lookup.
//
// Every agent's key, not just this hive's: the bucket is keyed by agent
@ -574,7 +574,7 @@ impl Policy {
// `hive_name`'s doc argues against.
subjects.push(format!(
"$JS.API.DIRECT.GET.{}.>",
swarm_queue_client::agent_limits::STREAM
swarm_wire::agent_limits::STREAM
));
// The permissions the swarm grants those agents
// (`swarm_queue_client::agent_permissions`), read the same way and
@ -847,7 +847,7 @@ mod tests {
/// grant reaches no other bucket.
#[test]
fn a_hive_may_read_every_agents_caps_and_write_none() {
use swarm_queue_client::agent_limits::{STREAM, direct_get_subject, key_subject};
use swarm_wire::agent_limits::{STREAM, direct_get_subject, key_subject};
let p = policy()
.permissions("hive-alpha")