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/node.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/node.rs')
| -rw-r--r-- | src/node.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node.rs b/src/node.rs index 8ba1373..c3be694 100644 --- a/src/node.rs +++ b/src/node.rs @@ -64,6 +64,11 @@ pub(crate) struct NodeConfig { /// (`access::registry::first_users`); empty elsewhere, and where none were named /// (the simulations: no registry). pub(crate) first_users: crate::access::registry::FirstUsers, + /// To sign the tokens this node issues (`access::token`); none in the simulations. + pub(crate) node_key: Option<Arc<crate::identity::NodeKey>>, + /// `--token-lifetime`, `--session-lifetime`. + pub(crate) token_lifetime: Duration, + pub(crate) session_lifetime: Duration, pub(crate) files: Arc<Files>, pub(crate) state_file: Option<Arc<StateFile>>, pub(crate) document_file: Option<Arc<DocumentFile>>, @@ -144,6 +149,9 @@ impl Node { links: Default::default(), protocol_writers: Arc::new(config.protocol_writers), first_users: Arc::new(config.first_users), + node_key: config.node_key, + token_lifetime: config.token_lifetime, + session_lifetime: config.session_lifetime, state_file: config.state_file, document_file: config.document_file, files: config.files, |
