1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-03-04 06:02:46 +01:00

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] <support@github.com>

* chore: fix rand upgrade items

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
dependabot[bot] 2025-02-23 18:57:16 +00:00 committed by GitHub
parent 109e6a4793
commit d514ad3af5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ actix-web = { version = "4", default-features = false, features = ["cookies", "s
anyhow = "1" anyhow = "1"
derive_more = { version = "2", features = ["display", "error", "from"] } derive_more = { version = "2", features = ["display", "error", "from"] }
rand = "0.8" rand = "0.9"
serde = { version = "1" } serde = { version = "1" }
serde_json = { version = "1" } serde_json = { version = "1" }
tracing = { version = "0.1.30", default-features = false, features = ["log"] } tracing = { version = "0.1.30", default-features = false, features = ["log"] }

View File

@ -1,4 +1,4 @@
use rand::distributions::{Alphanumeric, DistString as _}; use rand::distr::{Alphanumeric, SampleString as _};
use crate::storage::SessionKey; 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 /// [OWASP recommendations]: https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#session-id-entropy
pub fn generate_session_key() -> SessionKey { pub fn generate_session_key() -> SessionKey {
Alphanumeric Alphanumeric
.sample_string(&mut rand::thread_rng(), 64) .sample_string(&mut rand::rng(), 64)
.try_into() .try_into()
.expect("generated string should be within size range for a session key") .expect("generated string should be within size range for a session key")
} }