Skip to content

Commit fa933bf

Browse files
authored
Update ntex version (#25)
1 parent c58e76b commit fa933bf

File tree

11 files changed

+32
-30
lines changed

11 files changed

+32
-30
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ resolver = "3"
1111
[workspace.package]
1212
license = "MIT OR Apache-2.0"
1313
edition = "2024"
14-
rust-version = "1.85"
14+
rust-version = "1.88"

ntex-cors/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ name = "ntex_cors"
1717
path = "src/lib.rs"
1818

1919
[dependencies]
20-
ntex = "3.0.1"
20+
ntex = "3.2.0"
2121
derive_more = { version = "2", features = ["from", "display"] }
2222
futures = "0.3"
2323

2424
[dev-dependencies]
25-
ntex = { version = "3.0", features=["neon"] }
25+
ntex = { version = "3.2", features=["neon"] }

ntex-cors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! #[ntex::main]
2424
//! async fn main() -> std::io::Result<()> {
2525
//! web::server(async || App::new()
26-
//! .wrap(
26+
//! .middleware(
2727
//! Cors::new() // <- Construct CORS middleware builder
2828
//! .allowed_origin("https://www.rust-lang.org/")
2929
//! .allowed_methods(vec![http::Method::GET, http::Method::POST])

ntex-files/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "ntex_files"
1818
path = "src/lib.rs"
1919

2020
[dependencies]
21-
ntex = "3.0"
21+
ntex = "3.2"
2222
ntex-http = "1"
2323
bitflags = "2"
2424
futures = "0.3"
@@ -34,4 +34,4 @@ language-tags = "0.3"
3434
httpdate = "1.0"
3535

3636
[dev-dependencies]
37-
ntex = { version = "3.0.0", features = ["neon", "openssl", "compress"] }
37+
ntex = { version = "3.2.0", features = ["neon", "openssl", "compress"] }

ntex-files/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ mod tests {
10601060

10611061
#[ntex::test]
10621062
async fn test_named_file_content_encoding() {
1063-
let srv = test::init_service(App::new().wrap(Compress::default()).service(
1063+
let srv = test::init_service(App::new().middleware(Compress::default()).service(
10641064
web::resource("/").to(|| async {
10651065
NamedFile::open("Cargo.toml")
10661066
.unwrap()
@@ -1080,7 +1080,7 @@ mod tests {
10801080

10811081
#[ntex::test]
10821082
async fn test_named_file_content_encoding_gzip() {
1083-
let srv = test::init_service(App::new().wrap(Compress::default()).service(
1083+
let srv = test::init_service(App::new().middleware(Compress::default()).service(
10841084
web::resource("/").to(|| async {
10851085
NamedFile::open("Cargo.toml")
10861086
.unwrap()

ntex-identity/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default = ["cookie-policy"]
2222
cookie-policy = ["cookie/secure", "ntex/cookie"]
2323

2424
[dependencies]
25-
ntex = "3.0"
25+
ntex = "3.2"
2626
futures = "0.3"
2727
serde = "1.0"
2828
serde_json = "1.0"
@@ -31,4 +31,4 @@ cookie = { version = "0.18", features = ["private"] }
3131
time = { version = "0.3", default-features = false, features = ["std"] }
3232

3333
[dev-dependencies]
34-
ntex = { version = "3.0", features=["neon"] }
34+
ntex = { version = "3.2", features=["neon"] }

ntex-identity/src/lib.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! web::HttpResponse::Ok().finish()
3636
//! }
3737
//!
38-
//! let app = web::App::new().wrap(IdentityService::new(
38+
//! let app = web::App::new().middleware(IdentityService::new(
3939
//! // <- create identity middleware
4040
//! CookieIdentityPolicy::new(&[0; 32]) // <- create cookie identity policy
4141
//! .name("auth-cookie")
@@ -195,7 +195,7 @@ pub trait IdentityPolicy<Err>: Sized + 'static {
195195
/// use ntex::web::App;
196196
/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
197197
///
198-
/// let app = App::new().wrap(IdentityService::new(
198+
/// let app = App::new().middleware(IdentityService::new(
199199
/// // <- create identity middleware
200200
/// CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
201201
/// .name("auth-cookie")
@@ -419,7 +419,7 @@ impl CookieIdentityInner {
419419
/// use ntex::web::App;
420420
/// use ntex_identity::{CookieIdentityPolicy, IdentityService};
421421
///
422-
/// let app = App::new().wrap(IdentityService::new(
422+
/// let app = App::new().middleware(IdentityService::new(
423423
/// // <- create identity middleware
424424
/// CookieIdentityPolicy::new(&[0; 32]) // <- construct cookie policy
425425
/// .domain("www.rust-lang.org")
@@ -578,7 +578,7 @@ mod tests {
578578
async fn test_identity() {
579579
let srv = test::init_service(
580580
App::new()
581-
.wrap(IdentityService::new(
581+
.middleware(IdentityService::new(
582582
CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
583583
.domain("www.rust-lang.org")
584584
.name(COOKIE_NAME)
@@ -635,7 +635,7 @@ mod tests {
635635
let duration = Duration::days(1);
636636
let srv = test::init_service(
637637
App::new()
638-
.wrap(IdentityService::new(
638+
.middleware(IdentityService::new(
639639
CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
640640
.domain("www.rust-lang.org")
641641
.name(COOKIE_NAME)
@@ -661,7 +661,7 @@ mod tests {
661661
let seconds = 60;
662662
let srv = test::init_service(
663663
App::new()
664-
.wrap(IdentityService::new(
664+
.middleware(IdentityService::new(
665665
CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
666666
.domain("www.rust-lang.org")
667667
.name(COOKIE_NAME)
@@ -691,9 +691,11 @@ mod tests {
691691
> {
692692
test::init_service(
693693
App::new()
694-
.wrap(IdentityService::new(f(CookieIdentityPolicy::new(&COOKIE_KEY_MASTER)
695-
.secure(false)
696-
.name(COOKIE_NAME))))
694+
.middleware(IdentityService::new(f(CookieIdentityPolicy::new(
695+
&COOKIE_KEY_MASTER,
696+
)
697+
.secure(false)
698+
.name(COOKIE_NAME))))
697699
.service(web::resource("/").to(|id: Identity| async move {
698700
let identity = id.identity();
699701
if identity.is_none() {

ntex-multipart/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name = "ntex_multipart"
1717
path = "src/lib.rs"
1818

1919
[dependencies]
20-
ntex = "3.0"
20+
ntex = "3.2"
2121
derive_more = { version = "2", features = ["from", "display"] }
2222
httparse = "1.3"
2323
futures = "0.3"
@@ -26,4 +26,4 @@ mime = "0.3"
2626
twoway = "0.2"
2727

2828
[dev-dependencies]
29-
ntex = { version = "3.0", features=["neon"] }
29+
ntex = { version = "3.2", features=["neon"] }

ntex-session/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ default = ["cookie-session"]
2323
cookie-session = ["cookie/secure", "ntex/cookie"]
2424

2525
[dependencies]
26-
ntex = "3.0"
26+
ntex = "3.2"
2727
cookie = "0.18"
2828
derive_more = { version = "2", features = ["from", "display"] }
2929
futures = "0.3"
@@ -32,4 +32,4 @@ serde_json = "1.0"
3232
time = { version = "0.3", default-features = false, features = ["std"] }
3333

3434
[dev-dependencies]
35-
ntex = { version = "3.0", features=["neon"] }
35+
ntex = { version = "3.2", features=["neon"] }

ntex-session/src/cookie.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl CookieSessionInner {
194194
/// use ntex_session::CookieSession;
195195
/// use ntex::web::{self, App, HttpResponse, HttpServer};
196196
///
197-
/// let app = App::new().wrap(
197+
/// let app = App::new().middleware(
198198
/// CookieSession::signed(&[0; 32])
199199
/// .domain("www.rust-lang.org")
200200
/// .name("ntex-session")
@@ -363,7 +363,7 @@ mod tests {
363363
#[ntex::test]
364364
async fn cookie_session() {
365365
let app = test::init_service(
366-
App::new().wrap(CookieSession::signed(&[0; 32]).secure(false)).service(
366+
App::new().middleware(CookieSession::signed(&[0; 32]).secure(false)).service(
367367
web::resource("/").to(|ses: Session| async move {
368368
let _ = ses.set("counter", 100);
369369
"test"
@@ -380,7 +380,7 @@ mod tests {
380380
#[ntex::test]
381381
async fn private_cookie() {
382382
let app = test::init_service(
383-
App::new().wrap(CookieSession::private(&[0; 32]).secure(false)).service(
383+
App::new().middleware(CookieSession::private(&[0; 32]).secure(false)).service(
384384
web::resource("/").to(|ses: Session| async move {
385385
let _ = ses.set("counter", 100);
386386
"test"
@@ -397,7 +397,7 @@ mod tests {
397397
#[ntex::test]
398398
async fn cookie_session_extractor() {
399399
let app = test::init_service(
400-
App::new().wrap(CookieSession::signed(&[0; 32]).secure(false)).service(
400+
App::new().middleware(CookieSession::signed(&[0; 32]).secure(false)).service(
401401
web::resource("/").to(|ses: Session| async move {
402402
let _ = ses.set("counter", 100);
403403
"test"
@@ -415,7 +415,7 @@ mod tests {
415415
async fn basics() {
416416
let app = test::init_service(
417417
App::new()
418-
.wrap(
418+
.middleware(
419419
CookieSession::signed(&[0; 32])
420420
.path("/test/")
421421
.name("ntex-test")
@@ -454,7 +454,7 @@ mod tests {
454454
async fn prolong_expiration() {
455455
let app = test::init_service(
456456
App::new()
457-
.wrap(CookieSession::signed(&[0; 32]).secure(false).expires_in(60))
457+
.middleware(CookieSession::signed(&[0; 32]).secure(false).expires_in(60))
458458
.service(web::resource("/").to(|ses: Session| async move {
459459
let _ = ses.set("counter", 100);
460460
"test"

0 commit comments

Comments
 (0)