lzyuan549/dsh-plugin-auth ↗★ 0
dsh-plugin-auth
DSH Web UI 的企业级用户名/密码身份验证网关。无需修改核心代码,访问任何页面或 API 前必须先登录。
AI 分析
核心用途是为 DSH Web 界面提供安全的用户名密码登录验证网关。适合有多用户访问控制、企业级安全部署需求的团队或个人。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lzyuan549/dsh-plugin-auth说明文档
阅读完整 README ↗Configuration ($DSH_HOME/auth/config.json, optional)
All keys are optional; out-of-range or wrong-typed values silently fall back to the secure default, so a malformed file can never weaken the gate past sane bounds.
| Key | Default | Meaning |
|---|---|---|
sessionAbsoluteTtlMs | 43200000 (12h) | Hard session lifetime cap. |
sessionIdleTtlMs | 7200000 (2h) | Sliding idle window. |
sweepIntervalMs | 300000 (5m) | Background expired-session sweep cadence. |
lockoutThreshold | 5 | Consecutive failures (per username+IP) before lockout. |
lockoutBaseMs | 30000 | First lockout duration. |
lockoutMaxMs | 900000 (15m) | Exponential-backoff cap. |
lockoutWindowMs | 900000 (15m) | Idle time after which the failure counter resets. |
minPasswordLength | 12 | Minimum password length (floor 8). |
secure | false | true behind TLS: sets Secure + __Host- cookie, forces Path=/. |
sameSite | "Strict" | Cookie SameSite (Strict or Lax). |
cookiePath | "/" | Cookie Path. |
trustedOrigins | [] | Extra Origin values accepted on state-changing POSTs. |
scrypt | {N:16384,r:8,p:1,keylen:64,maxmem:64MiB} | Password hashing cost. |
Behind a TLS reverse proxy, set
"secure": trueso the session cookie getsSecureand the__Host-prefix. On plain loopback HTTP the cookie cannot beSecure(browsers would drop it).