diff --git a/actix-hash/Cargo.toml b/actix-hash/Cargo.toml index 7672f6ab..6d231334 100644 --- a/actix-hash/Cargo.toml +++ b/actix-hash/Cargo.toml @@ -27,7 +27,7 @@ sha3 = ["dep:sha3"] [dependencies] actix-http = "3" actix-web = { version = "4", default-features = false } -actix-web-lab = "0.20" +actix-web-lab = "0.21" futures-core = "0.3.17" futures-util = { version = "0.3.17", default-features = false, features = ["std"] } local-channel = "0.1" diff --git a/actix-web-lab-derive/Cargo.toml b/actix-web-lab-derive/Cargo.toml index e37b56a4..f620afe4 100644 --- a/actix-web-lab-derive/Cargo.toml +++ b/actix-web-lab-derive/Cargo.toml @@ -24,7 +24,7 @@ quote = "1" syn = { version = "2", features = ["full", "parsing"] } [dev-dependencies] -actix-web-lab = "0.20" +actix-web-lab = "0.21" actix-test = "0.1" actix-web = "4" diff --git a/actix-web-lab/CHANGELOG.md b/actix-web-lab/CHANGELOG.md index 5342eee3..339ee7a3 100644 --- a/actix-web-lab/CHANGELOG.md +++ b/actix-web-lab/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## 0.21.0 + - Remove use of `async-trait` on `RequestSignatureScheme` trait. - Deprecate `respond::Html` now it has graduated to Actix Web. diff --git a/actix-web-lab/Cargo.toml b/actix-web-lab/Cargo.toml index 1ab9f98a..25e99fa6 100644 --- a/actix-web-lab/Cargo.toml +++ b/actix-web-lab/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web-lab" -version = "0.20.2" +version = "0.21.0" description = "In-progress extractors and middleware for Actix Web" authors = ["Rob Ede "] keywords = ["actix", "http", "web", "framework", "async"] @@ -28,7 +28,7 @@ msgpack = ["rmp-serde"] spa = ["actix-files"] [dependencies] -actix-web-lab-derive = { version = "=0.20.0", optional = true } +actix-web-lab-derive = { version = "=0.21.0", optional = true } actix-http = "3" actix-router = "0.5" @@ -69,7 +69,7 @@ rmp-serde = { version = "1", optional = true } actix-files = { version = "0.6", optional = true } [dev-dependencies] -actix-web-lab-derive = "=0.20.0" +actix-web-lab-derive = "=0.21.0" actix-web = { version = "4", features = ["rustls-0_23"] } async_zip = { version = "0.0.17", features = ["deflate", "tokio"] } diff --git a/actix-web-lab/README.md b/actix-web-lab/README.md index dfa99b87..4e9e7d2c 100644 --- a/actix-web-lab/README.md +++ b/actix-web-lab/README.md @@ -5,10 +5,10 @@ [![crates.io](https://img.shields.io/crates/v/actix-web-lab?label=latest)](https://crates.io/crates/actix-web-lab) -[![Documentation](https://docs.rs/actix-web-lab/badge.svg)](https://docs.rs/actix-web-lab/0.20.2) +[![Documentation](https://docs.rs/actix-web-lab/badge.svg)](https://docs.rs/actix-web-lab/0.21.0) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web-lab.svg)
-[![dependency status](https://deps.rs/crate/actix-web-lab/0.20.2/status.svg)](https://deps.rs/crate/actix-web-lab/0.20.2) +[![dependency status](https://deps.rs/crate/actix-web-lab/0.21.0/status.svg)](https://deps.rs/crate/actix-web-lab/0.21.0) [![Download](https://img.shields.io/crates/d/actix-web-lab.svg)](https://crates.io/crates/actix-web-lab) [![codecov](https://codecov.io/gh/robjtede/actix-web-lab/branch/main/graph/badge.svg)](https://codecov.io/gh/robjtede/actix-web-lab) @@ -20,63 +20,63 @@ ### Responders -- `Csv`: efficient CSV streaming [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.Csv.html) -- `NdJson`: efficient NDJSON streaming [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.NdJson.html) -- `DisplayStream`: efficient line-by-line `Display` streaming [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.DisplayStream.html) -- `Html`: basic string wrapper that responds with HTML Content-Type [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.Html.html) -- `Cbor`: basic CBOR format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.Cbor.html) -- `MessagePack`: basic MessagePack format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/respond/struct.MessagePack.html) -- `Sse`: semantic server-sent events (SSE) responder with a channel-like interface [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/sse/index.html) +- `Csv`: efficient CSV streaming [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.Csv.html) +- `NdJson`: efficient NDJSON streaming [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.NdJson.html) +- `DisplayStream`: efficient line-by-line `Display` streaming [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.DisplayStream.html) +- `Html`: (graduated 🎉) basic string wrapper that responds with HTML Content-Type [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.Html.html) +- `Cbor`: basic CBOR format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.Cbor.html) +- `MessagePack`: basic MessagePack format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/respond/struct.MessagePack.html) +- `Sse`: semantic server-sent events (SSE) responder with a channel-like interface [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/sse/index.html) ### Middleware -- `from_fn`: use an async function as a middleware [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/fn.from_fn.html) -- `map_response`: use an async function to modify the response [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/fn.map_response.html) -- `map_response_body`: use an async function to modify the response body [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/fn.map_response_body.html) -- `RedirectHttps`: middleware to redirect traffic to HTTPS if connection is insecure with optional HSTS [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.RedirectHttps.html) -- `redirect_to_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/fn.redirect_to_www.html) -- `redirect_to_non_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/fn.redirect_to_non_www.html) -- `ErrorHandlers`: alternative error handler middleware with simpler interface [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.ErrorHandlers.html) -- `NormalizePath`: alternative path normalizing middleware with redirect option [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.NormalizePath.html) -- `CatchPanic`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.CatchPanic.html) -- `PanicReporter`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.PanicReporter.html) -- `LoadShed`: sheds load when the inner service isn't ready [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/middleware/struct.LoadShed.html) +- `from_fn`: use an async function as a middleware [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/fn.from_fn.html) +- `map_response`: use an async function to modify the response [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/fn.map_response.html) +- `map_response_body`: use an async function to modify the response body [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/fn.map_response_body.html) +- `RedirectHttps`: middleware to redirect traffic to HTTPS if connection is insecure with optional HSTS [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.RedirectHttps.html) +- `redirect_to_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/fn.redirect_to_www.html) +- `redirect_to_non_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/fn.redirect_to_non_www.html) +- `ErrorHandlers`: alternative error handler middleware with simpler interface [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.ErrorHandlers.html) +- `NormalizePath`: alternative path normalizing middleware with redirect option [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.NormalizePath.html) +- `CatchPanic`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.CatchPanic.html) +- `PanicReporter`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.PanicReporter.html) +- `LoadShed`: sheds load when the inner service isn't ready [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/middleware/struct.LoadShed.html) ### Extractors -- `LazyData`: app data/state initialized on first use [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.LazyData.html) -- `SwapData`: app data/state that can be replaced at runtime (alternative to `Data>`) [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.SwapData.html) -- `LocalData`: app data/state that uses an `Rc` internally, avoiding atomic overhead (alternative to `Data>`) [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.LocalData.html) -- `ThinData`: app data/state for cheaply-cloned types [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.ThinData.html) -- `Json`: simplified JSON extractor with const-generic payload limits [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.Json.html) -- `Path`: simplified path parameter extractor that supports destructuring [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.Path.html) -- `Query`: simplified query-string extractor that can also collect multi-value items [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.Query.html) -- `RequestSignature`: wraps an extractor and calculates a request signature alongside [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.RequestSignature.html) -- `BodyLimit`: wraps a body extractor and prevents DoS attacks by limiting payload size [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.BodyLimit.html) -- `Bytes`: simplified Bytes extractor with const-generic limits [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.Bytes.html) -- `UrlEncodedForm`: URL-encoded form extractor with const-generic payload size limit [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.UrlEncodedForm.html) -- `Host`: Host information taken from either URL or Host header [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/extract/struct.Host.html) +- `LazyData`: app data/state initialized on first use [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.LazyData.html) +- `SwapData`: app data/state that can be replaced at runtime (alternative to `Data>`) [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.SwapData.html) +- `LocalData`: app data/state that uses an `Rc` internally, avoiding atomic overhead (alternative to `Data>`) [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.LocalData.html) +- `ThinData`: app data/state for cheaply-cloned types [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.ThinData.html) +- `Json`: simplified JSON extractor with const-generic payload limits [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.Json.html) +- `Path`: simplified path parameter extractor that supports destructuring [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.Path.html) +- `Query`: simplified query-string extractor that can also collect multi-value items [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.Query.html) +- `RequestSignature`: wraps an extractor and calculates a request signature alongside [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.RequestSignature.html) +- `BodyLimit`: wraps a body extractor and prevents DoS attacks by limiting payload size [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.BodyLimit.html) +- `Bytes`: simplified Bytes extractor with const-generic limits [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.Bytes.html) +- `UrlEncodedForm`: URL-encoded form extractor with const-generic payload size limit [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.UrlEncodedForm.html) +- `Host`: Host information taken from either URL or Host header [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/extract/struct.Host.html) ### Macros -- `FromRequest`: Derive macro to implement `FromRequest` on an aggregate struct of other extractors [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/derive.FromRequest.html) +- `FromRequest`: Derive macro to implement `FromRequest` on an aggregate struct of other extractors [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/derive.FromRequest.html) ### Headers -- `StrictTransportSecurity`: Strict-Transport-Security (HSTS) configuration [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/header/struct.StrictTransportSecurity.html) -- `CacheControl`: Cache-Control typed header with support for modern directives [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/header/struct.CacheControl.html) -- `ContentLength`: Content-Length typed header [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/header/struct.ContentLength.html) -- `Forwarded`: Proxy and original client info [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/header/struct.Forwarded.html) +- `StrictTransportSecurity`: Strict-Transport-Security (HSTS) configuration [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/header/struct.StrictTransportSecurity.html) +- `CacheControl`: Cache-Control typed header with support for modern directives [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/header/struct.CacheControl.html) +- `ContentLength`: Content-Length typed header [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/header/struct.ContentLength.html) +- `Forwarded`: Proxy and original client info [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/header/struct.Forwarded.html) ### Body Types -- `channel`: a simple channel-like body type with a sender side that can be used from another thread [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/body/fn.channel.html) -- `writer`: a simple `AsyncWrite` body type [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/body/fn.writer.html) +- `channel`: a simple channel-like body type with a sender side that can be used from another thread [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/body/fn.channel.html) +- `writer`: a simple `AsyncWrite` body type [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/body/fn.writer.html) ### Services - `Redirect`: (graduated 🎉) simple redirects [(docs)](https://docs.rs/actix-web/4/actix_web/web/struct.Redirect.html) -- `spa`: Easy Single-page Application (SPA) service [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/web/fn.spa.html) +- `spa`: Easy Single-page Application (SPA) service [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/web/fn.spa.html) ### Route Guards @@ -84,12 +84,12 @@ ### Test Utilities -- `test_request`: construct `TestRequest` using an HTTP-like DSL [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/test/macro.test_request.html) -- `assert_response_matches`: quickly write tests that check various parts of a `ServiceResponse` [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/test/macro.assert_response_matches.html) +- `test_request`: construct `TestRequest` using an HTTP-like DSL [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/test/macro.test_request.html) +- `assert_response_matches`: quickly write tests that check various parts of a `ServiceResponse` [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/test/macro.assert_response_matches.html) ### Other Utilities -- `fork_request_payload`: effectively clone a request payload [(docs)](https://docs.rs/actix-web-lab/0.20.2/actix_web_lab/util/fn.fork_request_payload.html) +- `fork_request_payload`: effectively clone a request payload [(docs)](https://docs.rs/actix-web-lab/0.21.0/actix_web_lab/util/fn.fork_request_payload.html) ## Things To Know About This Crate