diff --git a/Cargo.lock b/Cargo.lock index b382c2a..8348327 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4711,28 +4711,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "middleware-example" -version = "1.0.0" -dependencies = [ - "actix-http", - "actix-web", - "actix-web-lab", - "env_logger", - "futures-util", - "log", - "pin-project", -] - -[[package]] -name = "middleware-ext-mut" -version = "1.0.0" -dependencies = [ - "actix-web", - "env_logger", - "log", -] - [[package]] name = "middleware-http-to-https" version = "1.0.0" @@ -4757,6 +4735,28 @@ dependencies = [ "log", ] +[[package]] +name = "middleware-request-extensions" +version = "1.0.0" +dependencies = [ + "actix-web", + "env_logger", + "log", +] + +[[package]] +name = "middleware-various" +version = "1.0.0" +dependencies = [ + "actix-http", + "actix-web", + "actix-web-lab", + "env_logger", + "futures-util", + "log", + "pin-project", +] + [[package]] name = "mime" version = "0.3.17" diff --git a/Cargo.toml b/Cargo.toml index 0110b57..eda4527 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,11 +41,11 @@ members = [ "json/json-validation", "json/json", "json/jsonrpc", - "middleware/middleware-encrypted-payloads", - "middleware/middleware-ext-mut", - "middleware/middleware-http-to-https", - "middleware/middleware", + "middleware/encrypted-payloads", + "middleware/http-to-https", "middleware/rate-limit", + "middleware/request-extensions", + "middleware/various", "protobuf", "run-in-thread", "server-sent-events", diff --git a/middleware/middleware-encrypted-payloads/Cargo.toml b/middleware/encrypted-payloads/Cargo.toml similarity index 85% rename from middleware/middleware-encrypted-payloads/Cargo.toml rename to middleware/encrypted-payloads/Cargo.toml index 258d401..64d88d0 100644 --- a/middleware/middleware-encrypted-payloads/Cargo.toml +++ b/middleware/encrypted-payloads/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "middleware-encrypted-payloads" version = "1.0.0" -edition = "2021" +publish.workspace = true +edition.workspace = true [dependencies] actix-http.workspace = true diff --git a/middleware/middleware-encrypted-payloads/README.md b/middleware/encrypted-payloads/README.md similarity index 100% rename from middleware/middleware-encrypted-payloads/README.md rename to middleware/encrypted-payloads/README.md diff --git a/middleware/middleware-encrypted-payloads/src/main.rs b/middleware/encrypted-payloads/src/main.rs similarity index 100% rename from middleware/middleware-encrypted-payloads/src/main.rs rename to middleware/encrypted-payloads/src/main.rs diff --git a/middleware/middleware-http-to-https/Cargo.toml b/middleware/http-to-https/Cargo.toml similarity index 84% rename from middleware/middleware-http-to-https/Cargo.toml rename to middleware/http-to-https/Cargo.toml index 9ae443d..b35b80f 100644 --- a/middleware/middleware-http-to-https/Cargo.toml +++ b/middleware/http-to-https/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "middleware-http-to-https" version = "1.0.0" -edition = "2021" +publish.workspace = true +edition.workspace = true [dependencies] actix-web = { workspace = true, features = ["rustls-0_21"] } diff --git a/middleware/middleware-http-to-https/README.md b/middleware/http-to-https/README.md similarity index 95% rename from middleware/middleware-http-to-https/README.md rename to middleware/http-to-https/README.md index b943f9d..6f1e440 100644 --- a/middleware/middleware-http-to-https/README.md +++ b/middleware/http-to-https/README.md @@ -15,6 +15,6 @@ Now, the only problem left to solve is, to listen to **HTTP** connections as wel ## Usage ```sh -cd middleware/middleware-http-to-https +cd middleware/http-to-https cargo run ``` diff --git a/middleware/middleware-http-to-https/cert.pem b/middleware/http-to-https/cert.pem similarity index 100% rename from middleware/middleware-http-to-https/cert.pem rename to middleware/http-to-https/cert.pem diff --git a/middleware/middleware-http-to-https/key.pem b/middleware/http-to-https/key.pem similarity index 100% rename from middleware/middleware-http-to-https/key.pem rename to middleware/http-to-https/key.pem diff --git a/middleware/middleware-http-to-https/src/main.rs b/middleware/http-to-https/src/main.rs similarity index 100% rename from middleware/middleware-http-to-https/src/main.rs rename to middleware/http-to-https/src/main.rs diff --git a/middleware/middleware-ext-mut/Cargo.toml b/middleware/request-extensions/Cargo.toml similarity index 57% rename from middleware/middleware-ext-mut/Cargo.toml rename to middleware/request-extensions/Cargo.toml index bec1f4f..e875e4c 100644 --- a/middleware/middleware-ext-mut/Cargo.toml +++ b/middleware/request-extensions/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "middleware-ext-mut" +name = "middleware-request-extensions" version = "1.0.0" -edition = "2021" +publish.workspace = true +edition.workspace = true [dependencies] actix-web.workspace = true diff --git a/middleware/middleware-ext-mut/README.md b/middleware/request-extensions/README.md similarity index 91% rename from middleware/middleware-ext-mut/README.md rename to middleware/request-extensions/README.md index 423bdd2..208e37e 100644 --- a/middleware/middleware-ext-mut/README.md +++ b/middleware/request-extensions/README.md @@ -1,11 +1,11 @@ # Middleware: Add/Retrieve Request-Local Data -This example showcases a middleware that adds and retrieves request-local data. See also the [middleware guide](https://actix.rs/docs/middleware/). +This example showcases a middleware that adds and retrieves request-local data. See also the [middleware guide](https://actix.rs/docs/middleware). ## Usage ```sh -cd middleware/middleware-ext-mut +cd middleware/request-extensions cargo run ``` diff --git a/middleware/middleware-ext-mut/src/add_msg.rs b/middleware/request-extensions/src/add_msg.rs similarity index 100% rename from middleware/middleware-ext-mut/src/add_msg.rs rename to middleware/request-extensions/src/add_msg.rs diff --git a/middleware/middleware-ext-mut/src/main.rs b/middleware/request-extensions/src/main.rs similarity index 100% rename from middleware/middleware-ext-mut/src/main.rs rename to middleware/request-extensions/src/main.rs diff --git a/middleware/middleware/Cargo.toml b/middleware/various/Cargo.toml similarity index 74% rename from middleware/middleware/Cargo.toml rename to middleware/various/Cargo.toml index 92b07da..6ff7fee 100644 --- a/middleware/middleware/Cargo.toml +++ b/middleware/various/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "middleware-example" +name = "middleware-various" version = "1.0.0" -edition = "2021" +publish.workspace = true +edition.workspace = true [dependencies] actix-http.workspace = true diff --git a/middleware/middleware/README.md b/middleware/various/README.md similarity index 88% rename from middleware/middleware/README.md rename to middleware/various/README.md index 6026dbd..0de435f 100644 --- a/middleware/middleware/README.md +++ b/middleware/various/README.md @@ -1,13 +1,14 @@ # Middleware: Various -This example showcases a bunch of different uses of middleware. See also the [Middleware guide](https://actix.rs/docs/middleware/). +This example showcases a bunch of different uses of middleware. + +See also the [Middleware guide](https://actix.rs/docs/middleware). ## Usage ```sh -cd basics/middleware +cd middleware/various cargo run -# Started http server: 127.0.0.1:8080 ``` Look in `src/main.rs` and comment the different middleware in/out to see how they function. diff --git a/middleware/middleware/src/main.rs b/middleware/various/src/main.rs similarity index 100% rename from middleware/middleware/src/main.rs rename to middleware/various/src/main.rs diff --git a/middleware/middleware/src/read_request_body.rs b/middleware/various/src/read_request_body.rs similarity index 100% rename from middleware/middleware/src/read_request_body.rs rename to middleware/various/src/read_request_body.rs diff --git a/middleware/middleware/src/read_response_body.rs b/middleware/various/src/read_response_body.rs similarity index 100% rename from middleware/middleware/src/read_response_body.rs rename to middleware/various/src/read_response_body.rs diff --git a/middleware/middleware/src/redirect.rs b/middleware/various/src/redirect.rs similarity index 100% rename from middleware/middleware/src/redirect.rs rename to middleware/various/src/redirect.rs diff --git a/middleware/middleware/src/simple.rs b/middleware/various/src/simple.rs similarity index 100% rename from middleware/middleware/src/simple.rs rename to middleware/various/src/simple.rs