Fix workspaceRegistry inject and restore WS UDS identity.

Stop Cordis throws on ctx.workspaceRegistry, inject the registry handle for provisioning, and bind login identity onto remote.mux WebSocket listeners so super_admin keeps all workspaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-08 09:48:44 +08:00
parent 42618379a5
commit a5ba9d52cc
4 changed files with 124 additions and 5 deletions

View file

@ -673,11 +673,13 @@ function installSettingsSection(ctx, entry, hooks) {
}
let _workspaceRegistry = null
async function ensureUserWorkspace(empNo) {
if (!_userWorkspaces || !_pluginCtx) return null
if (!_userWorkspaces) return null
try {
return await _userWorkspaces.ensureUserWorkspace(
_pluginCtx,
{ workspaceRegistryHandle: _workspaceRegistry },
_currentConfig?.workspaceRoot,
empNo,
)
@ -779,6 +781,11 @@ async function initServices(ctx, config) {
patchServer(wctx.webServer)
})
ctx.inject(['workspaceRegistry'], (wctx) => {
_workspaceRegistry = wctx.workspaceRegistry
ctx.logger?.info?.('[uds-auth] workspaceRegistry ready')
})
installDshAcl(ctx, {
sessionAcl: _sessionAcl,
userWorkspaces: _userWorkspaces,