aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-29 03:04:13 +0000
committertv <tv@krebsco.de>2026-11-29 03:04:13 +0000
commit10f4e55b1c7d88eef1454ea02488de239489789b (patch)
tree68d698c7fd0874cbf55318040c48b2024bf98e22 /src/swarm
parent2b4e99e1ed273da0f921eaec3e52300480acdf0a (diff)
document: screening what is received is the document's, the rules access control's
access::screen becomes document::screen: reading received bytes as changes, putting them in order, keeping those that wait or are refused, vouching by signatures and applying is all Automerge's shape, and has each change judged by the rules (access::rules) before it applies it.
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/roots.rs2
-rw-r--r--src/swarm/sync.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/swarm/roots.rs b/src/swarm/roots.rs
index 1df0129..7ce2bb9 100644
--- a/src/swarm/roots.rs
+++ b/src/swarm/roots.rs
@@ -25,8 +25,8 @@ use std::time::Duration;
use anyhow::{Result, bail};
use tracing::{error, info, warn};
-use crate::access::screen::RootPin;
use crate::document::replica::Epoch;
+use crate::document::screen::RootPin;
use crate::document::{ChangeHash, Document};
use crate::locks::MutexExt;
use crate::state::AppState;
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index 45698fa..517f67d 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -43,7 +43,7 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> {
let now_with = (ps.run_id, ps.epoch_seq);
match (refusing, ps.refused_with) {
(false, _) => ps.refused_with = None,
- // All it commits builds on what we refused (`access::screen`).
+ // All it commits builds on what we refused (`document::screen`).
(true, None) => {
ps.refused_with = Some(now_with);
trace!("Refusing the peer as a whole; not syncing with it");
@@ -686,13 +686,13 @@ pub(crate) async fn handle_sync(
.logged_signed(|doc, known, log| {
let result = (|| {
// Judged first, each as the policy it was written under has it
- // (`access::screen`), whether this document has one yet or not;
+ // (`document::screen`), whether this document has one yet or not;
// and vouched for by the signatures it sent too, where that policy
// requires them.
{
let bytes = message.take_changes();
known.offer(doc, std::mem::take(&mut signatures));
- let outcome = crate::access::screen::apply_bytes(
+ let outcome = crate::document::screen::apply_bytes(
doc,
epoch,
epoch_seq,
@@ -1025,12 +1025,12 @@ async fn download_and_apply_delta(
let heads_before = replica.heads().to_vec();
{
// Its signatures wait for its changes (`Signatures::offer`), each checked as
- // they are judged (`access::screen`), whether this document has a policy yet
+ // they are judged (`document::screen`), whether this document has a policy yet
// or not.
let epoch_seq = replica.epoch_seq;
let replica = &mut *replica;
replica.signatures.offer(&replica.doc, signatures);
- let outcome = crate::access::screen::apply_bytes(
+ let outcome = crate::document::screen::apply_bytes(
&mut replica.doc,
epoch,
epoch_seq,