From ec70060ae5fa665953741da921e28031b56bc5e0 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:09 +0100 Subject: auth: logging in, and tokens as bearers POST /auth/login (by htpasswd or the proxy), /auth/refresh, /auth/logout, GET /auth/whoami; every request may bring Authorization: Bearer instead of a password. --token-lifetime and --session-lifetime. Auth plan M2. --- src/state/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/state') diff --git a/src/state/mod.rs b/src/state/mod.rs index c420361..223c0c9 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -145,6 +145,10 @@ pub(crate) struct AppState { pub(crate) protocol_writers: Arc>, /// The swarm's first users, recorded by a genesis node (`NodeConfig::first_users`). pub(crate) first_users: Arc, + /// Signs the tokens this node issues (`NodeConfig::node_key`). + pub(crate) node_key: Option>, + pub(crate) token_lifetime: Duration, + pub(crate) session_lifetime: Duration, /// This node's own files, and how much it read and wrote them. pub(crate) files: Arc, /// This node's document on disk (`--document-file`), if configured. -- cgit v1.3.1