Repository navigation
[PR] Admit dsh-desktop://app origin on /__bili/ admin routes (DSH Desktop 0.13.0 panel) - #5203
ranxianglei wants to merge 7 commits into
Conversation
DSH Desktop 0.13.0 renamed its registered Electron protocol from dsh-app
to dsh-desktop (renderer flags --standard-schemes/--cors-schemes/
--fetch-schemes=dsh-desktop), so the settings pane's embed probe now
carries Origin: dsh-desktop://app. isTrustedAdminOrigin only
special-cased dsh-app:, so the probe hit the 403 gate, the cors read
was rejected, and the panel rendered "Failed to fetch" while model
proxying kept working.
Accept dsh-desktop: alongside dsh-app: with the same hostname pin
("app"). Same trust argument as #3513: browsers set Origin themselves,
page content cannot forge it, and each scheme exists only inside the
dsh Electron app; the loopback-socket + loopback-hostname checks stay
the real boundary. Behavior change: requests from origin
dsh-desktop://app to /__bili/* management routes go from 403 to
admitted (identical to the existing dsh-app://app allowance); every
other origin is unaffected.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7377-pr.5203.8f0a0cbThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5203.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) Sync done: merged origin/master (dc10c2d) into the branch, clean (no conflicts), then merged origin/ci-fixes (9c186cc) because the 5 red gates at the pre-sync head (mysql-contract, docs-sync, lifecycle-ledger-guard, config-surface-guard, docs-coverage) are byte-identical to master's own failures (inherited, not from this PR). Head is now |
(ai: vllm-qwen/qwen3.8-27b) Stale re-fire — no sync needed this round: master is still at |
(ai: vllm-qwen/qwen3.8-27b) Synced round 5: master advanced to |
Closes #5203
What
DSH Desktop 0.13.0 renamed its Electron custom protocol from
dsh-apptodsh-desktop(renderer flags--standard-schemes/--cors-schemes/--fetch-schemes=dsh-desktop). The settings pane's embed probe now carriesOrigin: dsh-desktop://app;isTrustedAdminOrigin()only special-caseddsh-app:, so the probe hit the 403 gate, the cors read was rejected, and the panel rendered "Failed to fetch" while model proxying / compression kept working.Fix
isTrustedAdminOrigin(src/server/admin.ts) acceptsdsh-desktop:alongsidedsh-app:, with the same hostname pin (app). Same trust argument as #3513: browsers set the Origin header themselves (page content cannot forge it), each scheme exists only inside the dsh Electron app as a registered custom protocol, and the loopback-socket + loopback-hostname checks remain the real boundary. The gate is a single choke point (admin dispatch +adminGateDenialfor diverted incremental turns), so one change covers all/__bili/*management routes including the Context-tab status route (#3862); the existing verbatim ACAO echo then makes the cors read succeed with no further change.Behavior change (old → new)
dsh-desktop://appto/__bili/*management routes: 403 → admitted (identical treatment to the existingdsh-app://appallowance). Intended — that is the fix.file:) still rejected; foreign hostnames under either dsh scheme still rejected.Tests
Extended
tests/dsh-panel-embed-cors.test.tswith positive+negative pairs for both schemes (gate test discipline):dsh-app://appanddsh-desktop://app→ 200 + ACAO echoed verbatim;dsh-app://evilanddsh-desktop://evil→ 403;file://still 403. Local targeted runs green:tests/dsh-panel-embed-cors.test.ts,tests/admin-origin.test.ts,tests/dsh-admin-relay.test.ts; typecheck clean. Full-suite verdict = CI on the pushed head.