From 13cba9b0be736433d8ac44c0ef046cb001918a07 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:09 +0100 Subject: store: keys_at tells no map from an empty one registry::exists counted any value at _continuum/users as a registry; keys_at answers None where there is no map, and its users (records, members, forget records, remakes) say what they make of it. Auth plan M1 (fix). --- src/access/registry.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/access') diff --git a/src/access/registry.rs b/src/access/registry.rs index e0cbe47..5899bdd 100644 --- a/src/access/registry.rs +++ b/src/access/registry.rs @@ -35,12 +35,15 @@ pub(crate) fn user_path(name: &str) -> Vec { /// Whether the swarm has a registry: until it has, every user a node lets in may do /// everything but write protocol data (`docs/access.md`, A swarm without a registry). pub(crate) fn exists(doc: &impl ReadDoc) -> bool { - store::is_map(doc, &users_dir()) + matches!(store::keys_at(doc, &users_dir()), Ok(Some(_))) } /// The registered users' names, sorted. pub(crate) fn names(doc: &impl ReadDoc) -> Vec { - let mut names = store::keys_at(doc, &users_dir()).unwrap_or_default(); + let mut names = store::keys_at(doc, &users_dir()) + .ok() + .flatten() + .unwrap_or_default(); names.sort(); names } -- cgit v1.3.1