diff options
Diffstat (limited to 'src/access/token.rs')
| -rw-r--r-- | src/access/token.rs | 9 |
1 files changed, 4 insertions, 5 deletions
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)); |
