From 545873b5b23dab6ea26f9a084281410b8c2786ef Mon Sep 17 00:00:00 2001 From: Chiu-Hsiang Hsu <2716047+wdv4758h@users.noreply.github.com> Date: Thu, 21 Oct 2021 13:10:00 +0000 Subject: [PATCH] update actix-web dependencies to v4 beta.10 (#203) Co-authored-by: Rob Ede --- actix-cors/CHANGES.md | 2 ++ actix-cors/Cargo.toml | 2 +- actix-identity/CHANGES.md | 3 +++ actix-identity/Cargo.toml | 4 +-- actix-identity/src/identity.rs | 1 - actix-protobuf/CHANGES.md | 4 ++- actix-protobuf/Cargo.toml | 2 +- .../examples/prost-example/Cargo.toml | 2 +- actix-protobuf/src/lib.rs | 1 - actix-redis/CHANGES.md | 3 +++ actix-redis/Cargo.toml | 8 +++--- actix-session/CHANGES.md | 4 ++- actix-session/Cargo.toml | 2 +- actix-session/src/lib.rs | 25 +++++++++---------- actix-web-httpauth/CHANGES.md | 3 +++ actix-web-httpauth/Cargo.toml | 2 +- actix-web-httpauth/src/extractors/basic.rs | 3 +-- actix-web-httpauth/src/extractors/bearer.rs | 3 +-- 18 files changed, 42 insertions(+), 32 deletions(-) diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 0d38931e8..06674b3e1 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -2,9 +2,11 @@ ## Unreleased - 2021-xx-xx * Make `Cors` middleware generic over body type [#195] +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] * Minimum supported Rust version (MSRV) is now 1.52. [#195]: https://github.com/actix/actix-extras/pull/195 +[#203]: https://github.com/actix/actix-extras/pull/203 ## 0.6.0-beta.2 - 2021-06-27 diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index 7de1aeb05..c58301e5a 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -17,7 +17,7 @@ name = "actix_cors" path = "src/lib.rs" [dependencies] -actix-web = { version = "4.0.0-beta.8", default-features = false } +actix-web = { version = "4.0.0-beta.10", default-features = false } actix-service = "2.0.0" derive_more = "0.99.5" diff --git a/actix-identity/CHANGES.md b/actix-identity/CHANGES.md index 92a9091e4..02644bf9f 100644 --- a/actix-identity/CHANGES.md +++ b/actix-identity/CHANGES.md @@ -1,8 +1,11 @@ # Changes ## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] * Minimum supported Rust version (MSRV) is now 1.52. +[#203]: https://github.com/actix/actix-extras/pull/203 + ## 0.4.0-beta.2 - 2020-06-27 * No notable changes. diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index 2218eb844..ba1bd7dd4 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -15,12 +15,12 @@ path = "src/lib.rs" [dependencies] actix-service = "2.0.0" -actix-web = { version = "4.0.0-beta.8", default-features = false, features = ["cookies", "secure-cookies"] } +actix-web = { version = "4.0.0-beta.10", default-features = false, features = ["cookies", "secure-cookies"] } futures-util = { version = "0.3.7", default-features = false } serde = "1.0" serde_json = "1.0" time = "0.2.23" [dev-dependencies] -actix-http = "3.0.0-beta.8" +actix-http = "3.0.0-beta.11" actix-rt = "2" diff --git a/actix-identity/src/identity.rs b/actix-identity/src/identity.rs index d41da796a..667c04c10 100644 --- a/actix-identity/src/identity.rs +++ b/actix-identity/src/identity.rs @@ -90,7 +90,6 @@ impl Identity { /// } /// ``` impl FromRequest for Identity { - type Config = (); type Error = Error; type Future = Ready>; diff --git a/actix-protobuf/CHANGES.md b/actix-protobuf/CHANGES.md index adcf0fb6d..872360803 100644 --- a/actix-protobuf/CHANGES.md +++ b/actix-protobuf/CHANGES.md @@ -1,10 +1,12 @@ # Changes ## Unreleased - 2020-xx-xx -* Minimum supported Rust version (MSRV) is now 1.52. * Bump `prost` version to 0.8. [#197] +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] +* Minimum supported Rust version (MSRV) is now 1.52. [#197]: https://github.com/actix/actix-extras/pull/197 +[#203]: https://github.com/actix/actix-extras/pull/203 ## 0.7.0-beta.1 - 2020-06-27 diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index 1da072ae7..159b63a45 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -19,7 +19,7 @@ path = "src/lib.rs" [dependencies] actix-rt = "2" -actix-web = { version = "4.0.0-beta.8", default_features = false } +actix-web = { version = "4.0.0-beta.10", default_features = false } derive_more = "0.99.5" futures-util = { version = "0.3.7", default-features = false } prost = { version = "0.8", default_features = false } diff --git a/actix-protobuf/examples/prost-example/Cargo.toml b/actix-protobuf/examples/prost-example/Cargo.toml index c1b8cdcdd..081f75795 100644 --- a/actix-protobuf/examples/prost-example/Cargo.toml +++ b/actix-protobuf/examples/prost-example/Cargo.toml @@ -8,7 +8,7 @@ authors = [ ] [dependencies] -actix-web = "4.0.0-beta.8" +actix-web = "4.0.0-beta.10" actix-protobuf = { path = "../../" } env_logger = "0.8" diff --git a/actix-protobuf/src/lib.rs b/actix-protobuf/src/lib.rs index 8eac14a5e..a03a9fdc2 100644 --- a/actix-protobuf/src/lib.rs +++ b/actix-protobuf/src/lib.rs @@ -124,7 +124,6 @@ impl FromRequest for ProtoBuf where T: Message + Default + 'static, { - type Config = ProtoBufConfig; type Error = Error; type Future = LocalBoxFuture<'static, Result>; diff --git a/actix-redis/CHANGES.md b/actix-redis/CHANGES.md index 661f292a0..3b05880b2 100644 --- a/actix-redis/CHANGES.md +++ b/actix-redis/CHANGES.md @@ -1,8 +1,11 @@ # Changes ## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] * Minimum supported Rust version (MSRV) is now 1.52. +[#203]: https://github.com/actix/actix-extras/pull/203 + ## 0.10.0-beta.2 - 2020-06-27 * No notable changes. diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index de190d7ed..9dfefa88f 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -32,7 +32,7 @@ web = [ 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-beta.5", default-features = false, features = ["connect"] } +actix-tls = { version = "3.0.0-beta.7", default-features = false, features = ["connect"] } log = "0.4.6" backoff = "0.2.1" @@ -45,15 +45,15 @@ tokio = { version = "1", features = ["sync"] } tokio-util = "0.6.1" # actix-session -actix-web = { version = "4.0.0-beta.8", default_features = false, optional = true } +actix-web = { version = "4.0.0-beta.10", default_features = false, optional = true } actix-session = { version = "0.5.0-beta.2", 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.3" -actix-http = "3.0.0-beta.8" +actix-test = "0.1.0-beta.5" +actix-http = "3.0.0-beta.11" actix-rt = "2.1" env_logger = "0.8" serde = { version = "1.0.101", features = ["derive"] } diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index 3f294179f..b04ecac80 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -1,10 +1,12 @@ # Changes ## Unreleased - 2020-xx-xx -* Minimum supported Rust version (MSRV) is now 1.52. * Impl `Clone` for `CookieSession`. [#201] +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] +* Minimum supported Rust version (MSRV) is now 1.52. [#201]: https://github.com/actix/actix-extras/pull/201 +[#203]: https://github.com/actix/actix-extras/pull/203 ## 0.5.0-beta.2 - 2020-06-27 diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index f05828428..c50318566 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -18,7 +18,7 @@ default = ["cookie-session"] cookie-session = ["actix-web/secure-cookies"] [dependencies] -actix-web = { version = "4.0.0-beta.8", default_features = false, features = ["cookies"] } +actix-web = { version = "4.0.0-beta.10", default_features = false, features = ["cookies"] } actix-service = "2.0.0" derive_more = "0.99.5" diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index 2f022d9eb..108193868 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -307,7 +307,6 @@ impl Session { impl FromRequest for Session { type Error = Error; type Future = Ready>; - type Config = (); #[inline] fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { @@ -321,8 +320,8 @@ mod tests { use super::*; - #[test] - fn session() { + #[actix_web::test] + async fn session() { let mut req = test::TestRequest::default().to_srv_request(); Session::set_session( @@ -342,8 +341,8 @@ mod tests { assert_eq!(changes, [("key2".to_string(), "\"value2\"".to_string())]); } - #[test] - fn get_session() { + #[actix_web::test] + async fn get_session() { let mut req = test::TestRequest::default().to_srv_request(); Session::set_session( @@ -356,8 +355,8 @@ mod tests { assert_eq!(res, Some(true)); } - #[test] - fn get_session_from_request_head() { + #[actix_web::test] + async fn get_session_from_request_head() { let mut req = test::TestRequest::default().to_srv_request(); Session::set_session( @@ -370,8 +369,8 @@ mod tests { assert_eq!(res, Some(10)); } - #[test] - fn purge_session() { + #[actix_web::test] + async fn purge_session() { let req = test::TestRequest::default().to_srv_request(); let session = Session::get_session(&mut *req.extensions_mut()); assert_eq!(session.0.borrow().status, SessionStatus::Unchanged); @@ -379,8 +378,8 @@ mod tests { assert_eq!(session.0.borrow().status, SessionStatus::Purged); } - #[test] - fn renew_session() { + #[actix_web::test] + async fn renew_session() { let req = test::TestRequest::default().to_srv_request(); let session = Session::get_session(&mut *req.extensions_mut()); assert_eq!(session.0.borrow().status, SessionStatus::Unchanged); @@ -388,8 +387,8 @@ mod tests { assert_eq!(session.0.borrow().status, SessionStatus::Renewed); } - #[test] - fn session_entries() { + #[actix_web::test] + async fn session_entries() { let session = Session(Rc::new(RefCell::new(SessionInner::default()))); session.insert("test_str", "val").unwrap(); session.insert("test_num", 1).unwrap(); diff --git a/actix-web-httpauth/CHANGES.md b/actix-web-httpauth/CHANGES.md index 0f06770ca..7ebd1cc02 100644 --- a/actix-web-httpauth/CHANGES.md +++ b/actix-web-httpauth/CHANGES.md @@ -1,8 +1,11 @@ # Changes ## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to v4.0.0-beta.10. [#203] * Minimum supported Rust version (MSRV) is now 1.52. +[#203]: https://github.com/actix/actix-extras/pull/203 + ## 0.6.0-beta.2 - 2020-06-27 * No notable changes. diff --git a/actix-web-httpauth/Cargo.toml b/actix-web-httpauth/Cargo.toml index 72d9cb2da..b59ae62aa 100644 --- a/actix-web-httpauth/Cargo.toml +++ b/actix-web-httpauth/Cargo.toml @@ -18,7 +18,7 @@ name = "actix_web_httpauth" path = "src/lib.rs" [dependencies] -actix-web = { version = "4.0.0-beta.8", default_features = false } +actix-web = { version = "4.0.0-beta.10", default_features = false } actix-service = "2.0.0" base64 = "0.13" futures-util = { version = "0.3.7", default-features = false } diff --git a/actix-web-httpauth/src/extractors/basic.rs b/actix-web-httpauth/src/extractors/basic.rs index 8f3507ce1..e8156e660 100644 --- a/actix-web-httpauth/src/extractors/basic.rs +++ b/actix-web-httpauth/src/extractors/basic.rs @@ -105,7 +105,6 @@ impl BasicAuth { impl FromRequest for BasicAuth { type Future = Ready>; - type Config = Config; type Error = AuthenticationError; fn from_request(req: &HttpRequest, _: &mut Payload) -> ::Future { @@ -115,7 +114,7 @@ impl FromRequest for BasicAuth { .map_err(|_| { // TODO: debug! the original error let challenge = req - .app_data::() + .app_data::() .map(|config| config.0.clone()) // TODO: Add trace! about `Default::default` call .unwrap_or_else(Default::default); diff --git a/actix-web-httpauth/src/extractors/bearer.rs b/actix-web-httpauth/src/extractors/bearer.rs index 142880711..ec67ee919 100644 --- a/actix-web-httpauth/src/extractors/bearer.rs +++ b/actix-web-httpauth/src/extractors/bearer.rs @@ -103,7 +103,6 @@ impl BearerAuth { } impl FromRequest for BearerAuth { - type Config = Config; type Future = Ready>; type Error = AuthenticationError; @@ -113,7 +112,7 @@ impl FromRequest for BearerAuth { .map(|auth| BearerAuth(auth.into_scheme())) .map_err(|_| { let bearer = req - .app_data::() + .app_data::() .map(|config| config.0.clone()) .unwrap_or_else(Default::default);