daifuyang/dsh-plugin--plugins-auth ↗★ 0
dsh-auth-plugin
Optional auth layer for dsh: login overlay for the Web GUI and /login, /logout, /whoami commands + a tools/pre-execute permission gate (POC).
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:daifuyang/dsh-plugin#a30db42814421e890a822f58dcc2c8ecb5ca94dd&path:plugins/auth说明文档
阅读完整 README ↗dsh-auth-plugin
Optional auth layer for dsh, packaged as a bundle per the publish tutorial.
Two halves, independent by design:
-
Browser wall: a server-side prefix route on
/covers any visitor without a session cookie. The SPA HTML is served either way, but the page renders a Vercel-style login card injected right after `` when the cookie is absent. The user stays on the same URL (e.g./sessions/abc) — there is no abrupt redirect to a separate/loginpage. Submitting the form posts to/auth/login; on success the server sets an HttpOnly cookie and the next navigation drops the overlay. -
Agent gate:
/login,/logout, and/whoamislash commands track per-Session auth state. Atools/pre-executewaterfall turns non-public tool calls into anaskdecision until the Session is logged in. Public tools (read_file,list_directory,web_search,web_fetch) are always allowed without login.
The browser cookie and the agent Session state are deliberately separate: a logged-in browser does not log the agent in, and vice versa.
Install
pnpm dsh plugin --profile add ./plugins/auth
pnpm dsh --profile
Config
- id: auth
name: dsh-auth-plugin
config:
requireLogin: true # default; set false to disable the agent-side gate
Credential policy
The expected username and password are resolved per request from the
credentials seam ($DSH_HOME/.credentials.yaml, then the process
environment). When neither source supplies a value, the POC defaults
dfy / 123456 are accepted. Harden by setting:
DSH_AUTH_USER=alice DSH_AUTH_PASSWORD='s3cret' pnpm dsh web
Known limitations and deferred work
- Auth state is per-
Session, not global; logging into one agent does not log into its subagents.