mirror of
https://github.com/actix/actix-extras.git
synced 2025-03-03 21:57:33 +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:
parent
109e6a4793
commit
d514ad3af5
@ -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"] }
|
||||
|
@ -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")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user