Validate that session cookie looks somewhat encrypted
This commit is contained in:
parent
0930ef45bb
commit
8d2ed31fef
1 changed files with 12 additions and 1 deletions
|
@ -13,7 +13,18 @@ fn validate_cookies<T>(response: &Response<T>) {
|
|||
.iter()
|
||||
.map(|c| Cookie::parse(c.to_str().unwrap()).unwrap())
|
||||
.collect();
|
||||
assert!(cookies.iter().any(|c| c.name() == dto::COOKIE_SESSION));
|
||||
let session = cookies
|
||||
.iter()
|
||||
.find_map(|c| {
|
||||
if c.name() == dto::COOKIE_SESSION {
|
||||
Some(c.value())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.unwrap();
|
||||
assert_ne!(session, TEST_USERNAME);
|
||||
assert_ne!(session, TEST_USERNAME_ADMIN);
|
||||
assert!(cookies.iter().any(|c| c.name() == dto::COOKIE_USERNAME));
|
||||
assert!(cookies.iter().any(|c| c.name() == dto::COOKIE_ADMIN));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue