From a8ee17b7513c0367b5a9e5a30ae290fe53dad88b Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:09 +0100 Subject: access: first users at genesis --bootstrap-users gives a new swarm a registry from its first change, each first user with everything; other users may do nothing until added. Without it the swarm has no registry and works as before. Auth plan M1. --- src/api/auth.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/api') diff --git a/src/api/auth.rs b/src/api/auth.rs index 400feed..f85b64e 100644 --- a/src/api/auth.rs +++ b/src/api/auth.rs @@ -52,6 +52,13 @@ fn load_users(path: &str) -> anyhow::Result> { Ok(users) } +/// The user names of the htpasswd file at `path` (`load_users`), sorted. +pub(crate) fn htpasswd_names(path: &str) -> anyhow::Result> { + let mut names: Vec = load_users(path)?.into_keys().collect(); + names.sort(); + Ok(names) +} + /// Who may use the HTTP API: the users of an htpasswd file (basic authentication), /// and the user a reverse proxy in front names (`--user-header`), if it is one of /// `--trusted-proxies`. -- cgit v1.3.1