wc24
|
36b71bd38e
|
feat: passwordHasher 可注入 — bcrypt 不再是 Shrimp 核心硬依赖
新增 IPasswordHasher 抽象 + bcryptHasher(默认,lazy import)+ plainHasher
(测试用)。Password 字段 reqFilter 和 UserModule.verifyPassword 都走
`Shrimp.passwordHasher`,消费方在启动期换实现就能彻底跳过 bcrypt。
import { Shrimp, plainHasher } from "shrimp-server"
Shrimp.passwordHasher = plainHasher
测试覆盖默认值、plain 端到端登录、自定义 hasher 被调用。
|
2026-05-23 16:57:27 +08:00 |
|