aboutsummaryrefslogtreecommitdiffstats
path: root/src/access
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-12 02:06:36 +0000
committertv <tv@krebsco.de>2026-11-12 03:26:34 +0100
commit97ae0ccf8eb0c0082d3989086f6c8258cd685625 (patch)
tree0d0916362d30410a6095c230c62c6a97f8e6a328 /src/access
parent81dc0ca6012372ff293e19549053fda84bca1eb0 (diff)
login: a login given a lifetime of its own ends its session's record with it
Ending a session records it in the document until the login's end (login_exp), so every token of the session, refreshed or handed over, is refused until none can live any longer. A login may ask a lifetime of its own (POST /auth/login with lifetime): its session ends with that token (session_exp), as a refresh never goes past it. Its login_exp is now that end too, so ending its session records it as long as one of its tokens can live, not for the node's whole session lifetime. A token refreshed with a lifetime (one handed to another member's dashboard) keeps the login's end.
Diffstat (limited to 'src/access')
-rw-r--r--src/access/token.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/access/token.rs b/src/access/token.rs
index 51c2449..2aefcd7 100644
--- a/src/access/token.rs
+++ b/src/access/token.rs
@@ -48,10 +48,11 @@ pub(crate) struct Claims {
/// Until when it may be refreshed (Unix ms): the login's end, or sooner for one that
/// was given a lifetime of its own (it ends its session with it).
pub(crate) session_exp: u64,
- /// The login's end (Unix ms), as it logged in: what no refresh changes, a token cut
- /// short included. An ended session is recorded until then (`registry::session_path`),
- /// so it covers every token of the session, wherever it ends. 0 in a token from
- /// before it was kept: `session_exp` then.
+ /// The login's end (Unix ms), as it logged in: the latest any token of the session
+ /// may be refreshed to (a login given a lifetime of its own ends with it), which no
+ /// refresh changes, a token cut short included. An ended session is recorded until
+ /// then (`registry::session_path`), so it covers every token of the session, wherever
+ /// it ends. Absent (0) in a token: `session_exp` then.
#[serde(default)]
pub(crate) login_exp: u64,
/// Less than the user may do: only what these allow too.