@islibaodong/dsh-login
Multi-user authentication gateway plugin for the DSH Web GUI, with per-role whole-UI gating
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:islibaodong/dsh-loginドキュメント
README 全文を読む ↗dsh-login
English | 简体中文
Adds a login page, user accounts, and per-user conversation isolation to the DeepSeek Harness Web GUI: every visit requires sign-in, ordinary users cannot see each other's conversations, and an admin manages all accounts from inside the GUI.
| Login page | User management (设置 → 用户管理) |
|---|---|
![]() | ![]() |
The problem it solves
The DSH Web GUI ships with no login — it assumes a single user on localhost. The moment you bind it to 0.0.0.0 (phone access, LAN sharing, a small team), anyone on that network can open your GUI: read every conversation, burn your configured model API keys, even change host settings.
dsh-login turns that exposure into a multi-user deployment:
- 🔐 Login wall — pages, static assets, SPA routes, the API, and WebSockets all require a valid session; unauthenticated visitors are redirected to
/login - 👥 Multiple accounts — the first visit creates the administrator account; further users are added by an admin right inside the GUI, no CLI needed
- 🙈 Conversation isolation — ordinary users see and act on their own conversations only (including their subagents/forks); the bridge wall denies non-whitelisted methods and narrows
session.list/session.search/workspace.listresponses to owned sessions, and the dispatch-seam guard ownership-checks every dispatch (including per-userworkspace.followframe filtering); other users' sessions, messages, and workspaces are invisible; credentials, host settings, and other admin domains are forbidden wholesale - 🎭 Whole-UI role gate — for ordinary users the gateway filters the client boot graph (
window.__DSH_BOOT__) before serving the page, so admin-only UI plugins never mount (uiRoleGate, on by default) - 🛠 User management — an admin-only 用户管理 entry in the main page's left sidebar opens the full panel; its 侧边栏显示 switch hides/shows that entry live. In the main page it renders as a proper full page (hero, 账户总数 / 在线 / 已禁用 stat tiles, then titled blocks: account list with an avatar column, new user, trusted hosts, and a 登录与访问 block whose switches sit as hairline rows); in 设置 → 用户管理 it stays a compact card stack. Inside: last-login time, online session count, reset password, disable, remove; disabling/removing/password-changes immediately revoke that user's live sessions. 设置 → 用户管理 always stays available as the recovery path
- 👑 Admin exception — the admin is not isolated: all sessions visible, full configuration access
- 🚪 Logout — every user gets a logout entry in their settings panel
- 🌐 Remote access friendly — reach the GUI through frp/隧道/tunnels or a LAN IP without hand-editing
trustedHosts: the/apihost-trust fence uses a live set (LAN literals +trustedHosts+ auto-learned hosts), and any successful login learns its Host into a persisted whitelist you can manage in 设置 → 用户管理
Current status
Current release: @islibaodong/dsh-login@0.3.17 — tracks DSH 0.2.2-rc.4; full suite 22 files / 302 tests green, CI green. Per-version release notes: GitHub Releases.
0.3.17 is a pure re-pin release onto DSH 0.2.2-rc.4. The rc.3 → rc.4 range touches three source files (liveshare tunnel-worker ELECTRON_RUN_AS_NODE, llm-deepseek content-safety refusal handling, one llm error constant), none of them remote-decorated, so the wire registry is byte-identical at 226 methods (no re-classification, buckets stay 140 user / 85 admin / 1 host-internal) and every mounted seam is unchanged. Verified live under a real rc.4 npm runtime (login wall owns the entry, owner 225 / user 140 capability split, alice 403 on the admin route). Detail: docs/adapt-dsh-0.2.2-rc.4.md.
0.3.16 redesigns the 用户管理 panel in the main page — the panel was written for the settings column, so in the wide main area it rendered as a narrow 720px stack hugging the left edge. It is now layout-aware (layout: 'main' | 'settings'): the main page gets a centred 1040px page column (hero, 账户总数 / 在线 / 已禁用 stat tiles, then four titled blocks — 账户列表 with an initial-avatar column and hairline rows, 新建用户, 访问白名单, 登录与访问 holding the three switches as hairline setting rows), while 设置 → 用户管理 keeps its compact card stack. Client-only: the server routes, persisted flags and the main-sidebar (un)registration are unchanged.
0.3.15 reworks the 用户管理 sidebar visibility control shipped in 0.3.13/0.3.14: the switch now gates the entry in the main page's left sidebar (the entry opens user management as a full panel) instead of the settings-panel section — 设置 → 用户管理 stays permanently reachable as the recovery path. The server surface is unchanged from 0.3.13 (GET/POST /api/auth/admin/settings/sidebar, usersSidebarVisible in GET /api/auth/me); the client live (un)registers the sidebar.panellist entry plus its main seat, no reload needed.
0.3.14 is a pure re-pin release: every seam the plugin mounts is byte-stable between DSH 0.2.2-rc.2 → rc.3, and the wire registry grows by exactly one method (deepseekChatImport.limits, the conversation-archive importer's upload-limits probe — owner-only upstream, admitted per-user). Verified live under the rc.3 runtime (login wall, owner 225 / user 140 capability split).
0.3.12 is a security release. It fixes issue #11: streaming methods (workspace.follow workspace trees, and id-carrying invokes such as session.page) travel the /api/remote.mux WebSocket, which the POST-only bridge wall never saw — an ordinary user could enumerate and enter other users' workspaces. Since 0.3.12 a dispatch-seam guard ships in-plugin: connection admission requires a live dsh-login session on the browser path (the WebSocket upgrade included), and the gateway's dispatch seams gate every browser call per user — non-user methods denied, id arguments ownership-checked, workspace.follow frames filtered per frame. It also carries the merged PR #12 fix (DSH 0.2.2 homepage 400) and the CI rewrite (Node 24 matrix, dist freshness gate).
Compatibility history
| dsh-login | DSH | Notes |
|---|---|---|
| 0.3.17 | 0.2.2-rc.4 | pure re-pin: devDeps retargeted to the rc.4 tuple; the range touches no remote-decorated source, so the wire surface stays 226 (140 / 85 / 1) and every mounted seam is byte-stable; suite 302 |
| 0.3.16 | 0.2.2-rc.3 | 用户管理 panel redesigned for the main page (centred 1040px page column, stat tiles, four titled blocks, switches as setting rows, avatar column); settings section keeps its card stack; client-only, server surface unchanged; suite 302 |
| 0.3.15 | 0.2.2-rc.3 | 用户管理 sidebar-visibility rework: the entry moves to the main page's left sidebar (settings section keeps the fixed recovery entry); server surface unchanged from 0.3.13; suite 299 |
| 0.3.14 | 0.2.2-rc.3 | pure re-pin: devDeps retargeted to the rc.3 tuple (wire surface 225 → 226, +deepseekChatImport.limits); all mounted seams byte-stable |
| 0.3.13 | 0.2.2-rc.2 | deps retargeted to the rc.2 tuple (wire surface 204 → 225, officeToPdf→officeKit) + 用户管理 sidebar-visibility toggle (侧边栏显示) |
| 0.3.12 | 0.2.2-rc.1 | issue #11 streaming-method isolation + PR #12 gateway fix |
| 0.3.11 | 0.2.2-rc.1 | dependency retarget onto the rc.1 line (vendor stable) |
| 0.3.10 | 0.2.2-alpha.3 | wire surface re-pinned 199 → 204 (schedule CRUD split, forge review) |
| 0.3.9 | 0.2.1-rc.5 | issue #10: the launch token never reaches remote clients |
| 0.3.8 | 0.2.2-alpha.2 | wire surface 146 → 199 (forge panel, session observation, CUA, liveshareShares) |
| 0.3.7 | 0.2.1-rc.3 | client-UI-only upstream release; zero adapter impact |
| 0.3.6 | 0.2.1-rc.2 | issue #4: allow-list re-derived from the real wire surface |
Older releases: see the releases page.
Upstream multi-user watch
Upstream DSH still ships no native user accounts — no user store, no login, no identity UI. What DSH 0.2.1-alpha.3 added is an authorize-only RBAC engine for non-owner Peers (packages/api/remote-access) plus multi-principal connection machinery; it never gates owner principals, and every dsh-login user arrives as one. dsh-login remains the account/authn layer.
- Ordinary users are conversation-only. In option A the native
connection/api-gatewayowns/apiand is agent-keyed. Three seams enforce the boundary — the first two ship in-plugin and are on by default:- Method allow-list + response narrowing on the bridge wall (
apiBridgeAuth): a non-admin POST whose wire endpoint is not on theUSER_ALLOWEDallow-list is denied — withquietDenials(default) as a wire-correct forbidden envelope, otherwise a plain 403.session.list/session.search/workspace.listresponses are narrowed to the user's own sessions/workspaces. - Dispatch-seam guard (shipped in 0.3.12, automatic — fixes issue #11): connection admission requires a live dsh-login session on the browser path — including the
/api/remote.muxWebSocket upgrade — and tags each browser peer with its dsh-login identity. The gateway's dispatch seams (dispatchRpc/openWireStream) then gate every browser call per user: non-user methods are denied, every id argument (sessionId/workspaceId/agentId/…) is ownership-checked against the sidecar, andworkspace.followstreams are filtered per frame with upstream's own per-principal semantics (narrowed baselines, delivered-set accounting, replace-resync on visibility loss, fail-closed on unknown frames). Untagged peers (launch-token CLI/SDK, host-internal calls) keep upstream semantics exactly. - REMOTE-layer guard (
wrapRemoteGateway, exported, optional): the deployment-side composition primitive over the public gateway API (docs/compose-guard.md). Since 0.3.12 the in-plugin guard already covers browser traffic, so composing this is optional belt-and-suspenders. Everything else is off limits:
- physical allow-list: the user-facing wire surface (
USER_ALLOWED, 140 of the 226 methods DSH 0.2.2-rc.4 exposes) —session.*(prompt/page/modelCatalog/selectModel/fork/attachment, the events/observe/state family, …),workspace.*,goals.*,subagents.*,terminal.*,job.*, the read-onlyworkspaceFiles.*/officeKit.*document preview, thellm.*model-picker reads,skills.list,commands.*,directoryPicker.*,schedule.*,speech.*,userQuestions.*,messageFeedback.*,sessionFeedback.record,fileUploads.upload,fileReferences.list,permissionPresets.catalog,productAnalytics.*,cotTranslation.*,sessionReferenceResolver.candidates, theremoteAccess.followgrant stream, and the 0.2.2 additions (forgePanel.*per-session,toolResults.watch,actionCards.act,pluginRecommendations.describe); any other wire method is refused. The list is exhaustive against the wire surface:tests/wire-surface.spec.tsfails if upstream renames or adds a method without a bucket (seedocs/adapt-dsh-0.2.1-rc.2-issue-4.md) - admin-only domains (
ADMIN_ONLY_METHODS, 85):credentials.*,settings.*,agentPresets.*, the native plugin manager (pluginManager.*,pluginMarket.*,pluginRegistryProbe.*,pluginInventory.*),dynamicCordisRunner.*,claudeCodeMods.*, the wholeaccount.*namespace (the single process-wide upstream DeepSeek Platform grant), CUA consent (cuaAccess.*),schedule.deleteInactive, and theliveshareShares.*share-management surface - host-internal:
workspace.initializeDefault(first-use plumbing; denied to users and never advertised) - an unknown method (not on this build's wire surface) is logged once per method to the host log with the target version, so an upstream rename leaves a diagnostic instead of a silent user-facing denial — refresh
src/api-filter.tsfrom the checkout withnode scripts/dump-wire-surface.mjs - workspace-scoped mutations are ownership-guarded by
workspaceId: a non-admin may onlyrename/delete/insertBeforea workspace that holds at least one of their own sessions, andcreateis confined to their own sandbox (workspaceRoot/) — so they cannot touch other users' workspaces or register a workspace pointing at an arbitrary host directory - the physical
session.exportchannel (target in the query string, outside the envelope) is ownership-guarded at the carrier - streaming:
workspace.followframes are filtered per user at the dispatch seam (above) — a user's workspace tree never contains another user's workspaces or sessionIds
- Method allow-list + response narrowing on the bridge wall (
- Whole-UI role gate (
uiRoleGate, on by default): for an ordinary session the gateway filters the client boot graph (window.__DSH_BOOT__) before serving the index — entries in theADMIN_ONLY_UI_PLUGINSdeny-list never mount. Presentation-only: the/apiallow-list stays the security boundary; admins get the unfiltered graph; unexpected shapes fail open. Granularity is per package — hiding one slot inside an allowed bundle is out of scope, and a plugin that self-registers exact routes (e.g./api/pet/pets) is outside the bridge wall's reach. The split is binary today (admin / ordinary); extending it to arbitrary roles is evaluated indocs/role-based-ui-gating.md— feasible without upstream changes, one shared role policy must feed all three seams. - Default user workspace (
defaultWorkspace, on by default): non-admin users get a per-user isolated default workspace on first/apiaccess —mkdirtheir sandbox (workspaceRoot/, default/workspaces/) → register it in the durable workspace registry → attach one session (sessions.create({ workspaceId }), the grouping shape) and record its ownership, so the workspace is immediately visible in the user'ssession.list/workspace.followand ready to use. This means a non-admin never starts out workspace-less on a public/FRP deployment; since 0.3.6 the native picker (directoryPicker.*) also works for them, withworkspace.createstill confined to their sandbox. Admins can toggle it live from the 设置 → 用户管理 panel's 默认用户工作空间 switch (persisted to/settings.json, effective immediately, no restart); turning it off does not remove existing workspaces. Provisioning is idempotent (once per user per process) and best-effort (failures never fail the triggering request). - Remote access compat (
remoteWebUiCompat, on by default): accommodates@linxin666/dsh-remote-web-uiunchanged. That popular plugin's/remotedevice-pairing gate 401s non-loopback (public FRP) desktop traffic — the model dialog, history, composer — independently of dsh-login's /api auth. When this flag is on, dsh-login writes remote-web-ui'senabled:true(which is what actually mounts its host routes; without it the server answers nothing and the client fail-closes onto a dead/remote405 wall) andrequirePairingForLan:false(a live, settings-backed flag re-read per request), so non-loopback traffic rides dsh-login's/apichannel gated by thedsh_sessioncookie instead. It also writespublicBaseUrlfrom theremoteWebUiPublicBaseUrlconfig when that is set — required for a public FRP/tunnel host so remote-web-ui's Host-header-based/api/pair/*fence trusts the ordinary-user origin (otherwise the browser there gets 403 on/api/pair/statusand the client still fail-closes onto/remote). No-op when remote-web-ui is not installed; admins toggle it live from the 设置 → 用户管理 panel's 远程访问兼容 switch (persisted, effective immediately). Note: withremoteWebUiCompatdefaulting to on, the pairing barr

