aboutsummaryrefslogtreecommitdiffstats
path: root/src/access/rules.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 19:38:26 +0000
committertv <tv@krebsco.de>2026-11-16 21:25:23 +0100
commit3fccc4f6859cf0b4d93e7d166142e1ab9255723f (patch)
tree7a76c8bfe5b186ec063feb8e454de583f0c87ff5 /src/access/rules.rs
parent69d2aace79eb61d800afa3a0779cfe3a9dfe1039 (diff)
access: what a change of a swarm holding a store writes
Every node judges a change of a swarm holding a store by what it writes, at its history (`docs/store.md`, What a change writes), in place of rules by path: `access::holding`. It writes events, each at `_continuum/events/<ID>` the bytes whose SHA-256 that is, no larger than the fold allows (the federation's 256 KiB), at a key held nowhere at the change's history; and its node's entry, with the member list's map where there is none. Everything else is refused, as closed: values outside `_continuum`, the policy, the swarm's ID, users, bans, the topology, remakes and their acks. Nothing deletes or replaces an event. A change names its node; the genesis change's writer names none, so no change under it is taken but the genesis change. In a swarm not holding a store, a change writing a policy naming one is refused: a swarm holds a store from its genesis change, or not at all. The inspector tells a put of bytes apart (`Action::PutBytes`), with the bytes, for the events' check. All of it behind the `federation` feature.
Diffstat (limited to 'src/access/rules.rs')
-rw-r--r--src/access/rules.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/access/rules.rs b/src/access/rules.rs
index 6844dc9..d1edfd5 100644
--- a/src/access/rules.rs
+++ b/src/access/rules.rs
@@ -167,6 +167,18 @@ pub(crate) fn judge_reading(
"a swarm turns strict only at its start or through a strict remake".to_owned(),
));
}
+ // A swarm holding a store: judged by what its changes write. A swarm holds one from
+ // its genesis change, or not at all.
+ #[cfg(feature = "federation")]
+ match policy {
+ Policy::Store(fold) => return super::holding::judge(&at, change, fold),
+ _ if super::holding::turns_store(change.ops) => {
+ return Err(Refusal::Rule(
+ "a swarm holds a store from its genesis change only".to_owned(),
+ ));
+ }
+ _ => {}
+ }
if !policy.enforced() {
return Ok(());
}