From a3e936154e07ba3b95157d26ffeae9364f3d5cef Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 7 Nov 2026 22:35:21 +0100 Subject: access: logouts apart from users' entries _continuum/logouts/ holds when a user's tokens were last revoked, written by the user itself or by one who may manage users, so users' entries can be signed by their managers alone. Auth plan M7. --- src/access/token.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/access/token.rs') diff --git a/src/access/token.rs b/src/access/token.rs index bfbce62..3af8672 100644 --- a/src/access/token.rs +++ b/src/access/token.rs @@ -265,19 +265,18 @@ mod tests { }); assert_eq!(verify(&doc, &token, "s", 1_500), Err(Refused::UnknownUser)); let mut alice = registry::entry("x", 0, &[(Vec::new(), &[Right::Read][..])]); - alice["tokensNotBefore"] = json!(1_000); change(&mut doc, |tx| { - store::write_path(tx, ®istry::user_path("alice"), &alice).unwrap() + store::write_path(tx, ®istry::user_path("alice"), &alice).unwrap(); + store::write_path(tx, ®istry::logouts_path("alice"), &json!(1_000)).unwrap() }); assert!(verify(&doc, &token, "s", 1_500).is_ok()); - alice["tokensNotBefore"] = json!(1_001); change(&mut doc, |tx| { - store::write_path(tx, ®istry::user_path("alice"), &alice).unwrap() + store::write_path(tx, ®istry::logouts_path("alice"), &json!(1_001)).unwrap() }); assert_eq!(verify(&doc, &token, "s", 1_500), Err(Refused::Revoked)); - alice["tokensNotBefore"] = json!(0); alice["disabled"] = json!(true); change(&mut doc, |tx| { + store::write_path(tx, ®istry::logouts_path("alice"), &json!(0)).unwrap(); store::write_path(tx, ®istry::user_path("alice"), &alice).unwrap() }); assert_eq!(verify(&doc, &token, "s", 1_500), Err(Refused::Disabled)); -- cgit v1.3.1