diff --git a/Cargo.lock b/Cargo.lock index 212f324..099b561 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2653,7 +2653,6 @@ dependencies = [ "password-hash", "pbkdf2", "quick-xml", - "rand 0.8.5", "reqwest", "rpassword", "rustical_caldav", @@ -2795,7 +2794,7 @@ dependencies = [ "hex", "http", "mime_guess", - "rand 0.8.5", + "rand 0.9.1", "rust-embed", "rustical_oidc", "rustical_store", @@ -2858,7 +2857,7 @@ dependencies = [ "http", "ical", "lazy_static", - "rand 0.8.5", + "rand 0.9.1", "regex", "rrule", "rstest", @@ -2886,7 +2885,6 @@ dependencies = [ "password-auth", "password-hash", "pbkdf2", - "rand 0.8.5", "rustical_ical", "rustical_store", "serde", diff --git a/Cargo.toml b/Cargo.toml index 10ae36f..a51557d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,7 +106,7 @@ rustical_oidc = { path = "./crates/oidc/" } rustical_ical = { path = "./crates/ical/"} chrono-tz = "0.10" chrono-humanize = "0.2" -rand = "0.8" +rand = "0.9" axum-extra = { version = "0.10", features = ["typed-header"] } rrule = "0.14" argon2 = "0.5" @@ -158,7 +158,6 @@ tracing-subscriber = { version = "0.3", features = [ ] } figment = { version = "0.10", features = ["env", "toml"] } tower-sessions.workspace = true -rand.workspace = true rpassword.workspace = true tower.workspace = true argon2.workspace = true diff --git a/crates/frontend/src/routes/app_token.rs b/crates/frontend/src/routes/app_token.rs index fad316d..d7520e2 100644 --- a/crates/frontend/src/routes/app_token.rs +++ b/crates/frontend/src/routes/app_token.rs @@ -10,13 +10,13 @@ use axum::{ use axum_extra::extract::Host; use headers::{ContentType, HeaderMapExt}; use http::{HeaderValue, StatusCode, header}; -use rand::{Rng, distributions::Alphanumeric}; +use rand::{Rng, distr::Alphanumeric}; use rustical_store::auth::{AuthenticationProvider, User}; use serde::Deserialize; use uuid::Uuid; pub fn generate_app_token() -> String { - rand::thread_rng() + rand::rng() .sample_iter(Alphanumeric) .map(char::from) .take(64) diff --git a/crates/store_sqlite/Cargo.toml b/crates/store_sqlite/Cargo.toml index 542b65f..8504326 100644 --- a/crates/store_sqlite/Cargo.toml +++ b/crates/store_sqlite/Cargo.toml @@ -19,6 +19,5 @@ chrono.workspace = true password-auth.workspace = true password-hash.workspace = true uuid.workspace = true -rand.workspace = true pbkdf2.workspace = true rustical_ical.workspace = true diff --git a/crates/store_sqlite/src/principal_store.rs b/crates/store_sqlite/src/principal_store.rs index e921d71..76b522c 100644 --- a/crates/store_sqlite/src/principal_store.rs +++ b/crates/store_sqlite/src/principal_store.rs @@ -1,8 +1,10 @@ use async_trait::async_trait; use derive_more::Constructor; use password_hash::PasswordHasher; -use pbkdf2::{Params, password_hash::SaltString}; -use rand::rngs::OsRng; +use pbkdf2::{ + Params, + password_hash::{SaltString, rand_core::OsRng}, +}; use rustical_store::{ Error, Secret, auth::{AuthenticationProvider, User, user::AppToken}, diff --git a/src/commands/mod.rs b/src/commands/mod.rs index ab03f1b..06f05fd 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,8 +1,7 @@ use argon2::password_hash::SaltString; use clap::{Parser, ValueEnum}; -use password_hash::PasswordHasher; +use password_hash::{PasswordHasher, rand_core::OsRng}; use pbkdf2::Params; -use rand::rngs::OsRng; use rustical_frontend::FrontendConfig; use crate::config::{ diff --git a/src/commands/principals.rs b/src/commands/principals.rs index 08fc593..2d5ae0e 100644 --- a/src/commands/principals.rs +++ b/src/commands/principals.rs @@ -5,9 +5,7 @@ use figment::{ Figment, providers::{Env, Format, Toml}, }; -use password_hash::PasswordHasher; -use password_hash::SaltString; -use rand::rngs::OsRng; +use password_hash::{PasswordHasher, SaltString, rand_core::OsRng}; use rustical_store::auth::{AuthenticationProvider, User, user::PrincipalType}; #[derive(Parser, Debug)]