From 9e67f120b797bae10bd226bbb4632f8d19a24361 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Thu, 11 Jun 2026 14:53:23 +0800 Subject: fix: Fix OsRng import and refactor Redis connection setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix password-hash version mismatch (0.6→0.5) causing OsRng to be gated behind missing getrandom feature; enable argon2 rand feature - Extract get_redis_connection() helper to deduplicate Redis client setup across authentication, repo control, and tests - Tighten username validation regex to require ≥2 chars and disallow leading/trailing dots or hyphens - Handle malformed cookies without split_once gracefully (continue instead of panic) - Fix typos: "rated commands" → "related commands" in CLI help text Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: KunoiSayami --- Cargo.toml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 0b7e8b2..5828b1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2024" [dependencies] anyhow = "1" -argon2 = "0.5" +argon2 = { version = "0.5", features = ["password-hash", "rand"] } password-hash = { version = "0.5", features = ["getrandom"] } async-trait = "0.1" base64 = "0.22" @@ -23,18 +23,14 @@ redis = { version = "1", features = ["tokio-comp"] } regex = "1" serde = { version = "1", features = ["derive"] } serde_json = "1" -sqlx = { version = "0.8", features = [ - "json", - "sqlite", - "runtime-tokio-rustls", -] } +sqlx = { version = "0.9", features = ["json", "sqlite", "runtime-tokio"] } tempfile = "3" itertools = "0.14" tokio = { version = "1", features = ["full"] } tokio-stream = "0.1" -toml = "0.9" +toml = "1" url = "2.1" -uuid = { version = "1.2.1", features = ["v4"] } +uuid = { version = "1.23", features = ["v4"] } [target.aarch64-unknown-linux-musl.dependencies] cpufeatures = "0.3" -- cgit v1.3.1