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 --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 318a94c..3b9e04b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -133,7 +133,7 @@ fn get_arg_matches(arguments: Option>) -> ArgMatches { ) .subcommand( Command::new("database") - .about("Database rated commands") + .about("Database related commands") .subcommand( Command::new("init") .about("Init sqlite database") @@ -154,7 +154,7 @@ fn get_arg_matches(arguments: Option>) -> ArgMatches { ) .subcommand( Command::new("user") - .about("Users rated commands") + .about("User related commands") .subcommand( Command::new("add") .about("Add user to database") @@ -177,7 +177,7 @@ fn get_arg_matches(arguments: Option>) -> ArgMatches { ) .subcommand( Command::new("repo") - .about("Repository ACL rated commands") + .about("Repository ACL related commands") .subcommand( Command::new("add") .about("Add user to repository") -- cgit v1.3.1