From 323d01fcca69f240957682ef6d3d789e27af3b3a Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 3 Feb 2022 22:33:47 +0000 Subject: [PATCH] bump actix-web to 4.0.0-rc.1 --- actix-cors/CHANGES.md | 3 +- actix-cors/Cargo.toml | 4 +-- actix-cors/src/builder.rs | 8 +++--- actix-cors/src/inner.rs | 4 +-- actix-cors/src/middleware.rs | 2 +- actix-cors/tests/tests.rs | 22 +++++++-------- actix-identity/CHANGES.md | 1 + actix-identity/Cargo.toml | 10 +++---- actix-identity/src/cookie.rs | 28 +++++++++---------- actix-identity/src/middleware.rs | 8 +++--- actix-protobuf/CHANGES.md | 1 + actix-protobuf/Cargo.toml | 4 +-- .../examples/prost-example/Cargo.toml | 4 +-- actix-protobuf/src/lib.rs | 6 ++-- actix-redis/CHANGES.md | 1 + actix-redis/Cargo.toml | 7 ++--- actix-redis/examples/authentication.rs | 2 +- actix-redis/examples/basic.rs | 2 +- actix-redis/src/redis.rs | 2 +- actix-redis/src/session.rs | 4 +-- actix-redis/tests/test_redis.rs | 4 +-- actix-session/CHANGES.md | 1 + actix-session/Cargo.toml | 4 +-- actix-session/src/cookie.rs | 14 +++++----- actix-web-httpauth/CHANGES.md | 1 + actix-web-httpauth/Cargo.toml | 4 +-- actix-web-httpauth/src/middleware.rs | 12 ++++---- 27 files changed, 84 insertions(+), 79 deletions(-) diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 6ea421773..89c2ad305 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +- Update `actix-web` dependency to `4.0.0-rc.1`. ## 0.6.0-beta.8 - 2021-12-29 @@ -8,7 +9,7 @@ ## 0.6.0-beta.7 - 2021-12-18 -- Update `actix-web` dependency to `4.0.0.beta-15`. [#216] +- Update `actix-web` dependency to `4.0.0-beta.15`. [#216] [#216]: https://github.com/actix/actix-extras/pull/216 diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index 8f0507d06..919152ba0 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -19,7 +19,7 @@ path = "src/lib.rs" [dependencies] actix-service = "2" actix-utils = "3" -actix-web = { version = "4.0.0-beta.17", default-features = false } +actix-web = { version = "4.0.0-rc.1", default-features = false } derive_more = "0.99.5" futures-util = { version = "0.3.7", default-features = false } @@ -28,6 +28,6 @@ once_cell = "1" smallvec = "1.6.1" [dev-dependencies] -actix-rt = "2" +actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros"] } env_logger = "0.9" regex = "1.4" diff --git a/actix-cors/src/builder.rs b/actix-cors/src/builder.rs index 0828eb840..67490c4ff 100644 --- a/actix-cors/src/builder.rs +++ b/actix-cors/src/builder.rs @@ -597,7 +597,7 @@ mod test { .is_err()); } - #[actix_rt::test] + #[actix_web::test] async fn restrictive_defaults() { let cors = Cors::default() .new_transform(test::ok_service()) @@ -612,12 +612,12 @@ mod test { assert_eq!(resp.status(), StatusCode::BAD_REQUEST); } - #[actix_rt::test] + #[actix_web::test] async fn allowed_header_try_from() { let _cors = Cors::default().allowed_header("Content-Type"); } - #[actix_rt::test] + #[actix_web::test] async fn allowed_header_try_into() { struct ContentType; @@ -632,7 +632,7 @@ mod test { let _cors = Cors::default().allowed_header(ContentType); } - #[actix_rt::test] + #[actix_web::test] async fn middleware_generic_over_body_type() { let srv = fn_service(|req: ServiceRequest| async move { Ok(req.into_response(HttpResponse::with_body(StatusCode::OK, body::None::new()))) diff --git a/actix-cors/src/inner.rs b/actix-cors/src/inner.rs index 6af485814..55ebf7c31 100644 --- a/actix-cors/src/inner.rs +++ b/actix-cors/src/inner.rs @@ -218,7 +218,7 @@ mod test { val.to_str().unwrap() } - #[actix_rt::test] + #[actix_web::test] async fn test_validate_not_allowed_origin() { let cors = Cors::default() .allowed_origin("https://www.example.com") @@ -236,7 +236,7 @@ mod test { assert!(cors.inner.validate_allowed_headers(req.head()).is_err()); } - #[actix_rt::test] + #[actix_web::test] async fn test_preflight() { let mut cors = Cors::default() .allow_any_origin() diff --git a/actix-cors/src/middleware.rs b/actix-cors/src/middleware.rs index 5dc437fba..ad186f050 100644 --- a/actix-cors/src/middleware.rs +++ b/actix-cors/src/middleware.rs @@ -195,7 +195,7 @@ mod tests { use super::*; use crate::Cors; - #[actix_rt::test] + #[actix_web::test] async fn test_options_no_origin() { // Tests case where allowed_origins is All but there are validate functions to run incase. // In this case, origins are only allowed when the DNT header is sent. diff --git a/actix-cors/tests/tests.rs b/actix-cors/tests/tests.rs index 7a4612c54..3b1a52664 100644 --- a/actix-cors/tests/tests.rs +++ b/actix-cors/tests/tests.rs @@ -17,7 +17,7 @@ fn val_as_str(val: &HeaderValue) -> &str { val.to_str().unwrap() } -#[actix_rt::test] +#[actix_web::test] #[should_panic] async fn test_wildcard_origin() { Cors::default() @@ -27,7 +27,7 @@ async fn test_wildcard_origin() { .unwrap(); } -#[actix_rt::test] +#[actix_web::test] async fn test_not_allowed_origin_fn() { let cors = Cors::default() .allowed_origin("https://www.example.com") @@ -73,7 +73,7 @@ async fn test_not_allowed_origin_fn() { } } -#[actix_rt::test] +#[actix_web::test] async fn test_allowed_origin_fn() { let cors = Cors::default() .allowed_origin("https://www.example.com") @@ -118,7 +118,7 @@ async fn test_allowed_origin_fn() { ); } -#[actix_rt::test] +#[actix_web::test] async fn test_allowed_origin_fn_with_environment() { let regex = Regex::new("https:.+\\.unknown\\.com").unwrap(); @@ -165,7 +165,7 @@ async fn test_allowed_origin_fn_with_environment() { ); } -#[actix_rt::test] +#[actix_web::test] async fn test_multiple_origins_preflight() { let cors = Cors::default() .allowed_origin("https://example.com") @@ -204,7 +204,7 @@ async fn test_multiple_origins_preflight() { ); } -#[actix_rt::test] +#[actix_web::test] async fn test_multiple_origins() { let cors = Cors::default() .allowed_origin("https://example.com") @@ -239,7 +239,7 @@ async fn test_multiple_origins() { ); } -#[actix_rt::test] +#[actix_web::test] async fn test_response() { let exposed_headers = vec![header::AUTHORIZATION, header::ACCEPT]; let cors = Cors::default() @@ -340,7 +340,7 @@ async fn test_response() { assert_eq!(Some("https://www.example.com"), origins_str); } -#[actix_rt::test] +#[actix_web::test] async fn test_validate_origin() { let cors = Cors::default() .allowed_origin("https://www.example.com") @@ -356,7 +356,7 @@ async fn test_validate_origin() { assert_eq!(resp.status(), StatusCode::OK); } -#[actix_rt::test] +#[actix_web::test] async fn test_no_origin_response() { let cors = Cors::permissive() .disable_preflight() @@ -384,7 +384,7 @@ async fn test_no_origin_response() { ); } -#[actix_rt::test] +#[actix_web::test] async fn validate_origin_allows_all_origins() { let cors = Cors::permissive() .new_transform(test::ok_service()) @@ -399,7 +399,7 @@ async fn validate_origin_allows_all_origins() { assert_eq!(resp.status(), StatusCode::OK); } -#[actix_rt::test] +#[actix_web::test] async fn test_allow_any_origin_any_method_any_header() { let cors = Cors::default() .allow_any_origin() diff --git a/actix-identity/CHANGES.md b/actix-identity/CHANGES.md index 079183ad1..897d03bc7 100644 --- a/actix-identity/CHANGES.md +++ b/actix-identity/CHANGES.md @@ -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 diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index c8cf25429..0101b205d 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -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"] } diff --git a/actix-identity/src/cookie.rs b/actix-identity/src/cookie.rs index bedef1a53..e2653e9c6 100644 --- a/actix-identity/src/cookie.rs +++ b/actix-identity/src/cookie.rs @@ -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)) diff --git a/actix-identity/src/middleware.rs b/actix-identity/src/middleware.rs index 67ad23e73..2c3fe8478 100644 --- a/actix-identity/src/middleware.rs +++ b/actix-identity/src/middleware.rs @@ -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::(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; } diff --git a/actix-protobuf/CHANGES.md b/actix-protobuf/CHANGES.md index 17316b75b..7dd8ddf6b 100644 --- a/actix-protobuf/CHANGES.md +++ b/actix-protobuf/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +- Update `actix-web` dependency to `4.0.0-rc.1`. ## 0.7.0-beta.5 - 2022-02-03 diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index eaa1650a4..b0da04fce 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -18,11 +18,11 @@ name = "actix_protobuf" path = "src/lib.rs" [dependencies] -actix-rt = "2" -actix-web = { version = "4.0.0-beta.17", default_features = false } +actix-web = { version = "4.0.0-rc.1", default_features = false } derive_more = "0.99.5" futures-util = { version = "0.3.7", default-features = false } prost = { version = "0.9", default_features = false } [dev-dependencies] +actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros"] } prost = { version = "0.9", default_features = false, features = ["prost-derive"] } diff --git a/actix-protobuf/examples/prost-example/Cargo.toml b/actix-protobuf/examples/prost-example/Cargo.toml index 125780730..cd4676ed2 100644 --- a/actix-protobuf/examples/prost-example/Cargo.toml +++ b/actix-protobuf/examples/prost-example/Cargo.toml @@ -8,8 +8,8 @@ authors = [ ] [dependencies] -actix-web = "4.0.0-beta.17" +actix-web = "4.0.0-rc.2" actix-protobuf = { path = "../../" } env_logger = "0.8" -prost = {version = "0.8", default_features = false, features = ["prost-derive"] } +prost = { version = "0.8", default_features = false, features = ["prost-derive"] } diff --git a/actix-protobuf/src/lib.rs b/actix-protobuf/src/lib.rs index 63cef2da2..1908bc30f 100644 --- a/actix-protobuf/src/lib.rs +++ b/actix-protobuf/src/lib.rs @@ -294,19 +294,19 @@ mod tests { pub name: String, } - #[actix_rt::test] + #[actix_web::test] async fn test_protobuf() { let protobuf = ProtoBuf(MyObject { number: 9, name: "test".to_owned(), }); let req = TestRequest::default().to_http_request(); - let resp = protobuf.respond_to(&req).await.unwrap(); + let resp = protobuf.respond_to(&req); let ct = resp.headers().get(header::CONTENT_TYPE).unwrap(); assert_eq!(ct, "application/protobuf"); } - #[actix_rt::test] + #[actix_web::test] async fn test_protobuf_message() { let (req, mut pl) = TestRequest::default().to_http_parts(); let protobuf = ProtoBufMessage::::new(&req, &mut pl).await; diff --git a/actix-redis/CHANGES.md b/actix-redis/CHANGES.md index a90458b83..faaf76cba 100644 --- a/actix-redis/CHANGES.md +++ b/actix-redis/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +- Update `actix-web` dependency to `4.0.0-rc.1`. ## 0.10.0-beta.5 - 2021-12-29 diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index eb202a162..3f1dcc29f 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -30,7 +30,6 @@ web = [ [dependencies] actix = { version = "0.12.0", default-features = false } -actix-rt = { version = "2.1", default-features = false } actix-service = "2.0.0" actix-tls = { version = "3.0.0-rc.2", default-features = false, features = ["connect"] } @@ -45,15 +44,15 @@ tokio = { version = "1.13.1", features = ["sync"] } tokio-util = "0.6.1" # actix-session -actix-web = { version = "4.0.0-beta.18", default_features = false, optional = true } +actix-web = { version = "4.0.0-rc.1", default_features = false, optional = true } actix-session = { version = "0.5.0-beta.7", optional = true } rand = { version = "0.8.0", optional = true } serde = { version = "1.0.101", optional = true } serde_json = { version = "1.0.40", optional = true } [dev-dependencies] -actix-test = "0.1.0-beta.10" -actix-rt = "2.1" +actix-test = "0.1.0-beta.12" +actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros"] } env_logger = "0.9" serde = { version = "1.0.101", features = ["derive"] } diff --git a/actix-redis/examples/authentication.rs b/actix-redis/examples/authentication.rs index 5f184bf23..bc709e6ec 100644 --- a/actix-redis/examples/authentication.rs +++ b/actix-redis/examples/authentication.rs @@ -68,7 +68,7 @@ async fn secret(session: Session) -> Result { Ok("secret revealed") } -#[actix_rt::main] +#[actix_web::main] async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_web=info,actix_redis=info"); env_logger::init(); diff --git a/actix-redis/examples/basic.rs b/actix-redis/examples/basic.rs index ae1ef1cb2..bdcd7f241 100644 --- a/actix-redis/examples/basic.rs +++ b/actix-redis/examples/basic.rs @@ -17,7 +17,7 @@ async fn index(req: HttpRequest, session: Session) -> Result std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_web=info,actix_redis=info"); env_logger::init(); diff --git a/actix-redis/src/redis.rs b/actix-redis/src/redis.rs index 979a941f0..8f5f51f0e 100644 --- a/actix-redis/src/redis.rs +++ b/actix-redis/src/redis.rs @@ -2,9 +2,9 @@ use std::collections::VecDeque; use std::io; use actix::prelude::*; -use actix_rt::net::TcpStream; use actix_service::boxed::{self, BoxService}; use actix_tls::connect::{ConnectError, ConnectInfo, Connection, ConnectorService}; +use actix_web::rt::net::TcpStream; use backoff::backoff::Backoff; use backoff::ExponentialBackoff; use log::{error, info, warn}; diff --git a/actix-redis/src/session.rs b/actix-redis/src/session.rs index 3f409e4be..d25f91006 100644 --- a/actix-redis/src/session.rs +++ b/actix-redis/src/session.rs @@ -447,7 +447,7 @@ mod test { Ok(HttpResponse::Ok().body(body)) } - #[actix_rt::test] + #[actix_web::test] async fn test_session_workflow() { // Step 1: GET index // - set-cookie actix-session should NOT be in response (session data is empty) @@ -653,7 +653,7 @@ mod test { ); } - #[actix_rt::test] + #[actix_web::test] async fn test_max_age_session_only() { // // Test that removing max_age results in a session-only cookie diff --git a/actix-redis/tests/test_redis.rs b/actix-redis/tests/test_redis.rs index b9bb9c390..6ae83f1e1 100644 --- a/actix-redis/tests/test_redis.rs +++ b/actix-redis/tests/test_redis.rs @@ -3,7 +3,7 @@ extern crate redis_async; use actix_redis::{Command, Error, RedisActor, RespValue}; -#[actix_rt::test] +#[actix_web::test] async fn test_error_connect() { let addr = RedisActor::start("localhost:54000"); let _addr2 = addr.clone(); @@ -15,7 +15,7 @@ async fn test_error_connect() { } } -#[actix_rt::test] +#[actix_web::test] async fn test_redis() { env_logger::init(); diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index 2f1e99717..c5c705e09 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +- Update `actix-web` dependency to `4.0.0-rc.1`. ## 0.5.0-beta.7 - 2021-12-29 diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 1cb2931fb..55c10d391 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -20,7 +20,7 @@ cookie-session = ["actix-web/secure-cookies"] [dependencies] actix-service = "2" actix-utils = "3" -actix-web = { version = "4.0.0-beta.18", default_features = false, features = ["cookies"] } +actix-web = { version = "4.0.0-rc.1", default_features = false, features = ["cookies"] } derive_more = "0.99.5" futures-util = { version = "0.3.7", default-features = false } @@ -30,4 +30,4 @@ serde_json = "1.0" time = "0.3" [dev-dependencies] -actix-rt = "2" +actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros", "cookies"] } diff --git a/actix-session/src/cookie.rs b/actix-session/src/cookie.rs index 493a9b180..f520d5fca 100644 --- a/actix-session/src/cookie.rs +++ b/actix-session/src/cookie.rs @@ -393,7 +393,7 @@ mod tests { use actix_web::web::Bytes; use actix_web::{test, web, App}; - #[actix_rt::test] + #[actix_web::test] async fn cookie_session() { let app = test::init_service( App::new() @@ -413,7 +413,7 @@ mod tests { .any(|c| c.name() == "actix-session")); } - #[actix_rt::test] + #[actix_web::test] async fn private_cookie() { let app = test::init_service( App::new() @@ -433,7 +433,7 @@ mod tests { .any(|c| c.name() == "actix-session")); } - #[actix_rt::test] + #[actix_web::test] async fn lazy_cookie() { let app = test::init_service( App::new() @@ -459,7 +459,7 @@ mod tests { .any(|c| c.name() == "actix-session")); } - #[actix_rt::test] + #[actix_web::test] async fn cookie_session_extractor() { let app = test::init_service( App::new() @@ -479,7 +479,7 @@ mod tests { .any(|c| c.name() == "actix-session")); } - #[actix_rt::test] + #[actix_web::test] async fn basics() { let app = test::init_service( App::new() @@ -520,7 +520,7 @@ mod tests { assert_eq!(body, Bytes::from_static(b"counter: 100")); } - #[actix_rt::test] + #[actix_web::test] async fn prolong_expiration() { let app = test::init_service( App::new() @@ -545,7 +545,7 @@ mod tests { .datetime() .expect("Expiration is a datetime"); - actix_rt::time::sleep(std::time::Duration::from_secs(1)).await; + actix_web::rt::time::sleep(std::time::Duration::from_secs(1)).await; let request = test::TestRequest::with_uri("/test/").to_request(); let response = app.call(request).await.unwrap(); diff --git a/actix-web-httpauth/CHANGES.md b/actix-web-httpauth/CHANGES.md index 7fb90ef33..9078d7481 100644 --- a/actix-web-httpauth/CHANGES.md +++ b/actix-web-httpauth/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2021-xx-xx +- Update `actix-web` dependency to `4.0.0-rc.1`. ## 0.6.0-beta.7 - 2021-12-29 diff --git a/actix-web-httpauth/Cargo.toml b/actix-web-httpauth/Cargo.toml index 61f0e8feb..3f4d71d1c 100644 --- a/actix-web-httpauth/Cargo.toml +++ b/actix-web-httpauth/Cargo.toml @@ -20,7 +20,7 @@ path = "src/lib.rs" [dependencies] actix-service = "2" actix-utils = "3" -actix-web = { version = "4.0.0-beta.17", default_features = false } +actix-web = { version = "4.0.0-rc.1", default_features = false } base64 = "0.13" futures-util = { version = "0.3.7", default-features = false } @@ -29,4 +29,4 @@ pin-project-lite = "0.2.7" [dev-dependencies] actix-cors = "0.6.0-beta.8" -actix-rt = "2" +actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros"] } diff --git a/actix-web-httpauth/src/middleware.rs b/actix-web-httpauth/src/middleware.rs index f93fc53cc..d3a9a4797 100644 --- a/actix-web-httpauth/src/middleware.rs +++ b/actix-web-httpauth/src/middleware.rs @@ -248,11 +248,11 @@ mod tests { use actix_web::{error, HttpResponse}; /// This is a test for https://github.com/actix/actix-extras/issues/10 - #[actix_rt::test] + #[actix_web::test] async fn test_middleware_panic() { let middleware = AuthenticationMiddleware { service: Rc::new(into_service(|_: ServiceRequest| async move { - actix_rt::time::sleep(std::time::Duration::from_secs(1)).await; + actix_web::rt::time::sleep(std::time::Duration::from_secs(1)).await; Err::(error::ErrorBadRequest("error")) })), process_fn: Arc::new(|req, _: BearerAuth| async { Ok(req) }), @@ -271,11 +271,11 @@ mod tests { } /// This is a test for https://github.com/actix/actix-extras/issues/10 - #[actix_rt::test] + #[actix_web::test] async fn test_middleware_panic_several_orders() { let middleware = AuthenticationMiddleware { service: Rc::new(into_service(|_: ServiceRequest| async move { - actix_rt::time::sleep(std::time::Duration::from_secs(1)).await; + actix_web::rt::time::sleep(std::time::Duration::from_secs(1)).await; Err::(error::ErrorBadRequest("error")) })), process_fn: Arc::new(|req, _: BearerAuth| async { Ok(req) }), @@ -307,7 +307,7 @@ mod tests { assert!(f3.is_err()); } - #[actix_rt::test] + #[actix_web::test] async fn test_middleware_opt_extractor() { let middleware = AuthenticationMiddleware { service: Rc::new(into_service(|req: ServiceRequest| async move { @@ -331,7 +331,7 @@ mod tests { assert!(f.is_ok()); } - #[actix_rt::test] + #[actix_web::test] async fn test_middleware_res_extractor() { let middleware = AuthenticationMiddleware { service: Rc::new(into_service(|req: ServiceRequest| async move {