dy-dashboard/vault/知识库/工作指南/训练记录/2026-07-23-用户密码不可逆哈希存储.md
2026-10-28 11:14:17 +08:00

12 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 用户密码不可逆哈希存储
### 1. 用户密码不可逆哈希存储
**旭东 → OpenClaw:**
> 先改第一个,密码改为不可逆哈希存储
**OpenClaw 响应:**
已按规则仅在 192.168.8.186 测试环境完成用户密码不可逆哈希改造,没有修改生产或云端。新增统一密码安全模块,使用带随机盐的 Werkzeug scrypt 哈希;登录改为哈希验证并拒绝明文数据库值;用户新增、管理员改密、CSV 导入及初始化账号全部只写入哈希。测试库 25 个现有账号已在单事务中转换,复核 25/25 均为 scrypt 哈希,账号原密码不变。自动更新脚本不再从数据库读取或尝试明文密码,改为可选环境变量。哈希单元测试、正确/错误登录、拒绝明文、用户新增/修改/导入回归均通过。服务已重启为 active,登录页 HTTP 200,错误登录正常返回 code=401,Gunicorn 4 个 worker 启动正常。Git 提交:7295e79(fix: store user passwords as scrypt hashes)。
**已记录**