From d7a6bc3ed201ff2ca953f74f62154e5e17728f22 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: access: rules by path access::rules::judge: a change judged as its writer saw the document (at its dependencies): committer a member or registering itself; members' entries and votes their own; epochs and swarm ID from roots; a remake's decision by its coordinator; the rest by the registry for the user the change names. Auth plan M6. --- src/document/meta.rs | 2 ++ src/document/signatures.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/document') diff --git a/src/document/meta.rs b/src/document/meta.rs index 0c3ee89..5966b3c 100644 --- a/src/document/meta.rs +++ b/src/document/meta.rs @@ -16,6 +16,7 @@ //! writer if need be (`swarm::topology::swarm_ways`). //! * `users/`: the user registry: who the users are, and what each may do //! (`access::registry`). +//! * `access/signed`: the paths whose writes are signed (`document::signatures`). /// The key every protocol path starts with. pub(crate) const ROOT: &str = "_continuum"; @@ -30,6 +31,7 @@ pub(crate) const RELAYS: &str = "relays"; pub(crate) const TOPOLOGY: &str = "topology"; pub(crate) const DISSEMINATION: &str = "dissemination"; pub(crate) const USERS: &str = "users"; +pub(crate) const ACCESS: &str = "access"; /// The store path `_continuum/`. pub(crate) fn path(parts: &[&str]) -> Vec { diff --git a/src/document/signatures.rs b/src/document/signatures.rs index d347e10..47e5917 100644 --- a/src/document/signatures.rs +++ b/src/document/signatures.rs @@ -24,7 +24,7 @@ use super::{ChangeHash, Document}; /// Where the swarm lists the paths whose writes are signed: a list of paths, each a /// list of segments, as capabilities name them (`access.md`). -pub(crate) const SIGNED_PATHS: [&str; 3] = ["_continuum", "access", "signed"]; +pub(crate) const SIGNED_PATHS: [&str; 3] = [super::meta::ROOT, super::meta::ACCESS, "signed"]; /// What a signature is made over: a domain, then the change's hash. pub(crate) fn message(hash: &ChangeHash) -> Vec { @@ -50,7 +50,7 @@ impl Sign { Sign::Protocol => true, Sign::Write { path, asked } => { *asked - || path.first().map(String::as_str) == Some(SIGNED_PATHS[0]) + || super::meta::is_protocol(path) || listed(doc).iter().any(|signed| related(signed, path)) } } -- cgit v1.3.1