aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-09 12:25:09 +0000
committertv <tv@krebsco.de>2026-11-09 13:32:05 +0100
commitd12ccc782d8e6eab46eb6e0976b747dca1013b36 (patch)
treede9d5ae9135a182dbb19a6067d240054483561d4 /src/document
parentb0e711f9f7e0d2d9f6b39dd987004d2f9b1dcda7 (diff)
access: ending a single session
Logging out of the dashboard (`DELETE /auth/session`) only cleared the cookie: the session's tokens stayed taken until they expired, by every node. Ending them took `POST /auth/logout`, which ends all of a user's sessions. Now `DELETE /auth/session` ends the session of the token it comes with (the cookie, or a bearer token): where the swarm has a registry, it is recorded as `_continuum/sessions/<user>/<session>` (`registry::session_path`), its value until when the session would have lasted, and every node refuses the session's tokens once the change reaches it (`token::Refused::Ended`): the page's own, its narrow tokens, and one handed to another member's dashboard, all refreshed from it and keeping its ID. The rules take the entry from the user itself or one who manages users, as a logout. A remake's snapshot leaves out entries past that time, a user's map where none is left: their tokens are expired anyway. Without a registry the document can't record it: the node ending it refuses the session's tokens itself (`AppState::ended_sessions`, until it restarts), others take them until they expire, as a logout there is refused.
Diffstat (limited to 'src/document')
-rw-r--r--src/document/meta.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/document/meta.rs b/src/document/meta.rs
index e040ba0..3b693cf 100644
--- a/src/document/meta.rs
+++ b/src/document/meta.rs
@@ -21,6 +21,8 @@
//! * `access/userSigned`: the paths whose values their users sign (`access::envelope`).
//! * `banned/<pk>`: banned nodes (`access::bans`).
//! * `logouts/<name>`: when a user's tokens were last revoked (`access::registry`).
+//! * `sessions/<name>/<session>`: a session of the user ended (logged out of), until
+//! when it would have lasted: its tokens aren't taken (`access::registry`).
//! * `local/<pk>/<name>`: never stored, and never writable: what a node holds alone
//! (its log filter, its configuration, its debug endpoints), named for capabilities
//! (`api::access::needed`).
@@ -41,6 +43,7 @@ pub(crate) const USERS: &str = "users";
pub(crate) const ACCESS: &str = "access";
pub(crate) const BANNED: &str = "banned";
pub(crate) const LOGOUTS: &str = "logouts";
+pub(crate) const SESSIONS: &str = "sessions";
pub(crate) const LOCAL: &str = "local";
/// The store path `_continuum/<parts…>`.