diff options
| author | tv <tv@krebsco.de> | 2026-11-07 22:35:09 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-07 22:35:09 +0100 |
| commit | ec70060ae5fa665953741da921e28031b56bc5e0 (patch) | |
| tree | cd1f6f5ae90d3ad87b9667da20d6e85b62394ab1 /src/state/mod.rs | |
| parent | eed8f86912f53f549d9f9068f9bdf2c8e23aa0f7 (diff) | |
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.
Diffstat (limited to 'src/state/mod.rs')
| -rw-r--r-- | src/state/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<std::collections::HashSet<String>>, /// The swarm's first users, recorded by a genesis node (`NodeConfig::first_users`). pub(crate) first_users: Arc<crate::access::registry::FirstUsers>, + /// Signs the tokens this node issues (`NodeConfig::node_key`). + pub(crate) node_key: Option<Arc<crate::identity::NodeKey>>, + 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<crate::files::Files>, /// This node's document on disk (`--document-file`), if configured. |
