From b6f815882a6d4a32c1198bd3666edaeaf1f7bca3 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: access: --bootstrap-keys The first users' SSH keys, recorded at genesis with their entries, so a swarm can be strict from its start. Auth plan M7. --- src/swarm/bootstrap.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/swarm/bootstrap.rs') diff --git a/src/swarm/bootstrap.rs b/src/swarm/bootstrap.rs index 10ad412..98e273a 100644 --- a/src/swarm/bootstrap.rs +++ b/src/swarm/bootstrap.rs @@ -100,12 +100,13 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) let users: Vec<(Vec, JsonValue)> = state .first_users .iter() - .map(|name| { + .map(|(name, keys)| { let caps = crate::access::registry::all_caps(); - ( - crate::access::registry::user_path(name), - crate::access::registry::entry(&by, since, &caps), - ) + let mut entry = crate::access::registry::entry(&by, since, &caps); + if !keys.is_empty() { + entry["keys"] = serde_json::json!(keys); + } + (crate::access::registry::user_path(name), entry) }) .collect(); state -- cgit v1.3.1