From d514ad3af5954d639be4a9fbbd25a1cb0a4262a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2025 18:57:16 +0000 Subject: [PATCH] build(deps): update rand requirement from 0.8 to 0.9 (#498) * build(deps): update rand requirement from 0.8 to 0.9 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.0...0.9.0) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production ... Signed-off-by: dependabot[bot] * chore: fix rand upgrade items --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede --- actix-session/Cargo.toml | 2 +- actix-session/src/storage/utils.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index a86cd7758..c4a7820bf 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -32,7 +32,7 @@ actix-web = { version = "4", default-features = false, features = ["cookies", "s anyhow = "1" derive_more = { version = "2", features = ["display", "error", "from"] } -rand = "0.8" +rand = "0.9" serde = { version = "1" } serde_json = { version = "1" } tracing = { version = "0.1.30", default-features = false, features = ["log"] } diff --git a/actix-session/src/storage/utils.rs b/actix-session/src/storage/utils.rs index 4dcfed7bb..a5bf4c07f 100644 --- a/actix-session/src/storage/utils.rs +++ b/actix-session/src/storage/utils.rs @@ -1,4 +1,4 @@ -use rand::distributions::{Alphanumeric, DistString as _}; +use rand::distr::{Alphanumeric, SampleString as _}; use crate::storage::SessionKey; @@ -7,7 +7,7 @@ use crate::storage::SessionKey; /// [OWASP recommendations]: https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#session-id-entropy pub fn generate_session_key() -> SessionKey { Alphanumeric - .sample_string(&mut rand::thread_rng(), 64) + .sample_string(&mut rand::rng(), 64) .try_into() .expect("generated string should be within size range for a session key") }