From abf75eeb06c5d873ac0377d949b868c68221b73f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:29:13 +0000 Subject: [PATCH] build(deps): update redis requirement from 0.24 to 0.25 (#412) * build(deps): update redis requirement from 0.24 to 0.25 Updates the requirements on [redis](https://github.com/redis-rs/redis-rs) to permit the latest version. - [Release notes](https://github.com/redis-rs/redis-rs/releases) - [Commits](https://github.com/redis-rs/redis-rs/compare/redis-0.24.0...redis-0.25.0) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production ... Signed-off-by: dependabot[bot] * refactor(session): rename TLS features --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede --- actix-identity/Cargo.toml | 2 +- actix-limitation/Cargo.toml | 2 +- actix-session/CHANGES.md | 4 +++- actix-session/Cargo.toml | 16 ++++++++-------- actix-session/README.md | 12 ++++++------ actix-session/src/lib.rs | 12 ++++++------ actix-session/src/storage/mod.rs | 6 +++--- justfile | 14 +++++++++++++- 8 files changed, 41 insertions(+), 27 deletions(-) diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index 7f8542195..30d7c411a 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -31,7 +31,7 @@ tracing = { version = "0.1.30", default-features = false, features = ["log"] } [dev-dependencies] actix-http = "3" actix-web = { version = "4", default-features = false, features = ["macros", "cookies", "secure-cookies"] } -actix-session = { version = "0.9", features = ["redis-rs-session", "cookie-session"] } +actix-session = { version = "0.9", features = ["redis-session", "cookie-session"] } env_logger = "0.11" reqwest = { version = "0.11", default-features = false, features = ["cookies", "json"] } diff --git a/actix-limitation/Cargo.toml b/actix-limitation/Cargo.toml index 1ae6d85c9..c1d29d730 100644 --- a/actix-limitation/Cargo.toml +++ b/actix-limitation/Cargo.toml @@ -28,7 +28,7 @@ actix-web = { version = "4", default-features = false, features = ["cookies"] } chrono = "0.4" derive_more = "0.99.7" log = "0.4" -redis = { version = "0.24", default-features = false, features = ["tokio-comp"] } +redis = { version = "0.25", default-features = false, features = ["tokio-comp"] } time = "0.3" # session diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index c32126834..1cdc19e25 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -2,7 +2,9 @@ ## Unreleased -- Added support for using `rustls` in `actix-session` instead of `native-tls` +- Add `redis-session-rustls` crate feature that enables `rustls`-secured Redis sessions. +- Rename `redis-rs-session` crate feature to `redis-session`. +- Rename `redis-rs-tls-session` crate feature to `redis-session-native-tls`. - Remove `redis-actor-session` crate feature (and, therefore, the `actix-redis` based storage backend). ## 0.9.0 diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 7083e8db6..baf3ff3d6 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -20,9 +20,9 @@ all-features = true [features] default = [] cookie-session = [] -redis-rs-session = ["redis", "rand"] -redis-rs-tls-session = ["redis-rs-session", "redis/tokio-native-tls-comp"] -redis-rs-tls-session-rustls = ["redis-rs-session", "redis/tokio-rustls-comp"] +redis-session = ["dep:redis", "dep:rand"] +redis-session-native-tls = ["redis-session", "redis/tokio-native-tls-comp"] +redis-session-rustls = ["redis-session", "redis/tokio-rustls-comp"] [dependencies] actix-service = "2" @@ -36,11 +36,11 @@ serde = { version = "1" } serde_json = { version = "1" } tracing = { version = "0.1.30", default-features = false, features = ["log"] } -# redis-rs-session -redis = { version = "0.24", default-features = false, features = ["tokio-comp", "connection-manager"], optional = true } +# redis-session +redis = { version = "0.25", default-features = false, features = ["tokio-comp", "connection-manager"], optional = true } [dev-dependencies] -actix-session = { path = ".", features = ["cookie-session", "redis-rs-session"] } +actix-session = { path = ".", features = ["cookie-session", "redis-session"] } actix-test = "0.1.0-beta.10" actix-web = { version = "4", default-features = false, features = ["cookies", "secure-cookies", "macros"] } tracing-subscriber = {version = "0.3", features = ["env-filter"]} @@ -48,8 +48,8 @@ tracing = "0.1.30" [[example]] name = "basic" -required-features = ["redis-rs-session"] +required-features = ["redis-session"] [[example]] name = "authentication" -required-features = ["redis-rs-session"] +required-features = ["redis-session"] diff --git a/actix-session/README.md b/actix-session/README.md index 70272a948..210a81d02 100644 --- a/actix-session/README.md +++ b/actix-session/README.md @@ -100,28 +100,28 @@ By default, `actix-session` does not provide any storage backend to retrieve and actix-session = { version = "...", features = ["cookie-session"] } ``` -- a Redis-based backend via [`redis-rs`](https://docs.rs/redis-rs), [`RedisSessionStore`], using the `redis-rs-session` feature flag. +- a Redis-based backend via [`redis-rs`](https://docs.rs/redis-rs), [`RedisSessionStore`], using the `redis-session` feature flag. ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-session"] } + actix-session = { version = "...", features = ["redis-session"] } ``` - Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate): + Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate): ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-tls-session"] } + actix-session = { version = "...", features = ["redis-session-native-tls"] } ``` - If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag: + If you instead prefer depending on `rustls`, use the `redis-session-rustls` feature flag: ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] } + actix-session = { version = "...", features = ["redis-session-rustls"] } ``` You can implement your own session storage backend using the [`SessionStore`] trait. diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index 66696d60b..ff5e159fe 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -107,29 +107,29 @@ attached to your sessions. You can enable: ``` - a Redis-based backend via [`redis-rs`](https://docs.rs/redis-rs), [`RedisSessionStore`], using - the `redis-rs-session` feature flag. + the `redis-session` feature flag. ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-session"] } + actix-session = { version = "...", features = ["redis-session"] } ``` - Add the `redis-rs-tls-session` feature flag if you want to connect to Redis using a secured + Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secured connection (via the `native-tls` crate): ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-tls-session"] } + actix-session = { version = "...", features = ["redis-session-native-tls"] } ``` - If you instead prefer depending on `rustls`, use the `redis-rs-tls-session-rustls` feature flag: + If you instead prefer depending on `rustls`, use the `redis-session-rustls` feature flag: ```toml [dependencies] # ... - actix-session = { version = "...", features = ["redis-rs-tls-session-rustls"] } + actix-session = { version = "...", features = ["redis-session-rustls"] } ``` You can implement your own session storage backend using the [`SessionStore`] trait. diff --git a/actix-session/src/storage/mod.rs b/actix-session/src/storage/mod.rs index 5f6552097..5c6022b17 100644 --- a/actix-session/src/storage/mod.rs +++ b/actix-session/src/storage/mod.rs @@ -11,13 +11,13 @@ pub use self::{ #[cfg(feature = "cookie-session")] mod cookie; -#[cfg(feature = "redis-rs-session")] +#[cfg(feature = "redis-session")] mod redis_rs; -#[cfg(feature = "redis-rs-session")] +#[cfg(feature = "redis-session")] mod utils; #[cfg(feature = "cookie-session")] pub use cookie::CookieSessionStore; -#[cfg(feature = "redis-rs-session")] +#[cfg(feature = "redis-session")] pub use redis_rs::{RedisSessionStore, RedisSessionStoreBuilder}; diff --git a/justfile b/justfile index f641032a8..f94149f9c 100644 --- a/justfile +++ b/justfile @@ -1,13 +1,25 @@ # depends on: # - https://crates.io/crates/fd-find # - https://crates.io/crates/cargo-check-external-types + _list: @just --list +msrv := ``` + cargo metadata --format-version=1 \ + | jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \ + | sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' +``` +msrv_rustup := "+" + msrv + +# Run Clippy over workspace. +clippy toolchain="": + cargo {{ toolchain }} clippy --workspace --all-targets --all-features + # Format workspace. fmt: update-readmes cargo +nightly fmt - npx -y prettier --write $(fd --hidden --extension=yml --extension=md) + fd --hidden --extension=yml --extension=md --exec-batch npx -y prettier --write # Update READMEs from crate root documentation. update-readmes: