1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-08-31 11:26:59 +02:00

bump actix-web to 4.0.0-rc.1

This commit is contained in:
Rob Ede
2022-02-03 22:33:47 +00:00
parent 6abec48e29
commit 323d01fcca
27 changed files with 84 additions and 79 deletions

View File

@@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Update `actix-web` dependency to `4.0.0-rc.1`.
## 0.4.0-beta.8 - 2022-01-21

View File

@@ -16,13 +16,13 @@ path = "src/lib.rs"
[dependencies]
actix-service = "2"
actix-utils = "3"
actix-web = { version = "4.0.0-beta.21", default-features = false, features = ["cookies", "secure-cookies"] }
actix-web = { version = "4.0.0-rc.1", default-features = false, features = ["cookies", "secure-cookies"] }
futures-util = { version = "0.3.7", default-features = false }
serde = "1.0"
serde_json = "1.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
time = "0.3"
[dev-dependencies]
actix-http = "3.0.0-beta.15"
actix-rt = "2"
actix-http = "3.0.0-rc.1"
actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros", "cookies", "secure-cookies"] }

View File

@@ -455,7 +455,7 @@ mod tests {
}
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_flow() {
let srv = test::init_service(
App::new()
@@ -514,7 +514,7 @@ mod tests {
assert!(resp.headers().contains_key(header::SET_COOKIE))
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_max_age_time() {
let duration = Duration::days(1);
@@ -542,7 +542,7 @@ mod tests {
assert_eq!(duration, c.max_age().unwrap());
}
#[actix_rt::test]
#[actix_web::test]
async fn test_http_only_same_site() {
let srv = test::init_service(
App::new()
@@ -610,7 +610,7 @@ mod tests {
assert!(cookies.get(COOKIE_NAME).is_none());
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_max_age() {
let seconds = 60;
let srv = test::init_service(
@@ -636,7 +636,7 @@ mod tests {
assert_eq!(Duration::seconds(seconds as i64), c.max_age().unwrap());
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_legacy_cookie_is_set() {
let srv = create_identity_server(|c| c).await;
let mut resp = test::call_service(&srv, TestRequest::with_uri("/").to_request()).await;
@@ -644,7 +644,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_legacy_cookie_works() {
let srv = create_identity_server(|c| c).await;
let cookie = legacy_login_cookie(COOKIE_LOGIN);
@@ -659,7 +659,7 @@ mod tests {
assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_legacy_cookie_rejected_if_visit_timestamp_needed() {
let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
let cookie = legacy_login_cookie(COOKIE_LOGIN);
@@ -679,7 +679,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_legacy_cookie_rejected_if_login_timestamp_needed() {
let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
let cookie = legacy_login_cookie(COOKIE_LOGIN);
@@ -699,7 +699,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_rejected_if_login_timestamp_needed() {
let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
let cookie = login_cookie(COOKIE_LOGIN, None, Some(SystemTime::now()));
@@ -719,7 +719,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_rejected_if_visit_timestamp_needed() {
let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
@@ -739,7 +739,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_rejected_if_login_timestamp_too_old() {
let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
let cookie = login_cookie(
@@ -763,7 +763,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_rejected_if_visit_timestamp_too_old() {
let srv = create_identity_server(|c| c.visit_deadline(Duration::days(90))).await;
let cookie = login_cookie(
@@ -787,7 +787,7 @@ mod tests {
assert_logged_in(resp, None).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_not_updated_on_login_deadline() {
let srv = create_identity_server(|c| c.login_deadline(Duration::days(90))).await;
let cookie = login_cookie(COOKIE_LOGIN, Some(SystemTime::now()), None);
@@ -802,7 +802,7 @@ mod tests {
assert_logged_in(resp, Some(COOKIE_LOGIN)).await;
}
#[actix_rt::test]
#[actix_web::test]
async fn test_identity_cookie_updated_on_visit_deadline() {
let srv = create_identity_server(|c| {
c.visit_deadline(Duration::days(90))

View File

@@ -127,7 +127,7 @@ mod tests {
use super::*;
#[actix_rt::test]
#[actix_web::test]
async fn test_borrowed_mut_error() {
use actix_utils::future::{ok, Ready};
use futures_util::future::lazy;
@@ -154,7 +154,7 @@ mod tests {
let srv = crate::middleware::IdentityServiceMiddleware {
backend: Rc::new(Ident),
service: Rc::new(into_service(|_: dev::ServiceRequest| async move {
actix_rt::time::sleep(Duration::from_secs(100)).await;
actix_web::rt::time::sleep(Duration::from_secs(100)).await;
Err::<dev::ServiceResponse, _>(error::ErrorBadRequest("error"))
})),
};
@@ -162,11 +162,11 @@ mod tests {
let srv2 = srv.clone();
let req = test::TestRequest::default().to_srv_request();
actix_rt::spawn(async move {
actix_web::rt::spawn(async move {
let _ = srv2.call(req).await;
});
actix_rt::time::sleep(Duration::from_millis(50)).await;
actix_web::rt::time::sleep(Duration::from_millis(50)).await;
let _ = lazy(|cx| srv.poll_ready(cx)).await;
}