aboutsummaryrefslogtreecommitdiffstats
path: root/src/access
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-07 22:35:09 +0100
committertv <tv@krebsco.de>2026-11-07 22:35:09 +0100
commit13cba9b0be736433d8ac44c0ef046cb001918a07 (patch)
tree09272f50d6d27cab6200a33fcdc7abb9e552e46c /src/access
parentec70060ae5fa665953741da921e28031b56bc5e0 (diff)
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).
Diffstat (limited to 'src/access')
-rw-r--r--src/access/registry.rs7
1 files changed, 5 insertions, 2 deletions
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<String> {
/// 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<String> {
- 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
}