From 320425f7e7f4c5d27d7dbc5e1eb68efbd9d22317 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Mon, 23 Mar 2026 20:34:02 +0800 Subject: [PATCH] refactor: remove unused is_legacy_dashboard_password_hash Remove the dead is_legacy_dashboard_password_hash helper which was never used by verify_dashboard_password. Legacy SHA-256/MD5 hashes are not supported - only Argon2 and PBKDF2 are valid password hashes. Users with old SHA-256 hashes must reset their password. --- astrbot/cli/commands/cmd_conf.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/astrbot/cli/commands/cmd_conf.py b/astrbot/cli/commands/cmd_conf.py index ed6215e7b..7281d7ec9 100644 --- a/astrbot/cli/commands/cmd_conf.py +++ b/astrbot/cli/commands/cmd_conf.py @@ -95,16 +95,6 @@ def is_dashboard_password_hash(value: str) -> bool: return value.startswith("$argon2") or value.startswith("pbkdf2_sha256$") -def is_legacy_dashboard_password_hash(value: str) -> bool: - """ - Return True when `value` looks like an old dashboard password hash format. - """ - if not isinstance(value, str) or not value: - return False - value_l = value.lower() - return len(value_l) in {32, 64} and all(ch in "0123456789abcdef" for ch in value_l) - - # --- Validators for CLI configuration items ---