diff options
| author | tv <tv@krebsco.de> | 2026-11-29 03:15:05 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 03:15:05 +0000 |
| commit | 9188fa6e13ea7facfab5fb6f55bf26444ec2c01e (patch) | |
| tree | 28b33908d0519bd21b03ee18bb34126c484ec0bb /src/access/challenge.rs | |
| parent | c396d33a34ee6685e9a561baa4d3ae4956b697be (diff) | |
document: values read and written through a view any kind of document gives
document::view: Read (the value at a path, plain, typed, a map's keys)
and Write (a value written, one deleted), which Automerge's documents,
writes in progress and documents as they were all are. The member
registry, the users, access control's reads and rules, the topology,
forgetting and bootstrap read and write through them, and name neither
Automerge's ReadDoc and Transactable nor document::store, which is what
an Automerge document can do beyond.
How a swarm holding a store judges what a change writes is handed to
the rules (rules::judge_seen), being its kind of document's to say.
Diffstat (limited to 'src/access/challenge.rs')
| -rw-r--r-- | src/access/challenge.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/access/challenge.rs b/src/access/challenge.rs index 8df0f08..4dd8dfb 100644 --- a/src/access/challenge.rs +++ b/src/access/challenge.rs @@ -16,7 +16,7 @@ use base64::{Engine, engine::general_purpose::URL_SAFE_NO_PAD as B64URL}; use serde::{Deserialize, Serialize}; use super::{registry, sshsig}; -use crate::document::ReadDoc; +use crate::document::view::Read; use crate::identity::NodeKey; /// What a user's signature over a challenge is for (`sshsig`). @@ -70,7 +70,7 @@ pub(crate) struct Used(HashMap<String, (u64, String)>); /// `per_user` of its own still remembered. Why not, if not. #[allow(clippy::too_many_arguments)] pub(crate) fn take( - doc: &impl ReadDoc, + doc: &impl Read, key: &NodeKey, challenge: &str, signature: &str, @@ -150,8 +150,8 @@ pub(crate) fn take_with( mod tests { use super::*; use crate::document::Document; - use crate::document::store; use crate::document::testing::change; + use crate::document::view; use ed25519_dalek::SigningKey; use serde_json::json; @@ -163,12 +163,12 @@ mod tests { change(&mut doc, |doc| { let mut alice = registry::entry("root", 1, &[]); alice["keys"] = json!({ "laptop": line }); - store::write_path(doc, ®istry::user_path("alice"), &alice).unwrap(); + view::write_path(doc, ®istry::user_path("alice"), &alice).unwrap(); let mut carol = registry::entry("root", 1, &[]); carol["keys"] = json!({ "laptop": line }); carol["disabled"] = json!(true); - store::write_path(doc, ®istry::user_path("carol"), &carol).unwrap(); - store::write_path( + view::write_path(doc, ®istry::user_path("carol"), &carol).unwrap(); + view::write_path( doc, ®istry::user_path("bob"), ®istry::entry("root", 1, &[]), |
