# Validation record Results captured on the machine that this plugin was developed and tested on. They are recorded here as evidence; re-run the commands to reproduce. ## Environment | Item | Value | | --- | --- | | DSH version | `0.1.5-rc.2` | | DSH install | global `@deepseek-ai/dsh` (`/usr/lib/node_modules/@deepseek-ai/dsh`) | | Node version | `v24.21.0` | | Test isolation | throwaway `DSH_HOME` under `/tmp`, private profile derived from the shipped `web` template, loopback port selected at runtime | | DSH install files modified | none (`find … -newermt` returned no files) | | Production profile touched | no (the running server and its profile were left untouched) | ## Unit tests — 86 passed, 0 failed ```console $ npm test ℹ tests 86 ℹ suites 9 ℹ pass 86 ℹ fail 0 ``` Coverage: `requestRejection` result mapping (including pass-through of an unexpected upstream status); `authorizeIndex` decision tree; proxy bootstrap HTML injection (`__DSH_TRANSPORT__.ownsHost = true` script insertion via `webServer.tapIndex` and `webserver/index-inject` in `
`, ``, or fragment; idempotency; Buffer handling; native response preservation); `normalizeToLoopback` authority and origin rewriting (custom ports, port 80, plain objects, Fetch `Headers`, case insensitivity, idempotency); `webServer.match` / `webServer.handle` third-party plugin route compatibility (`dshmarket@1.65.1` discovery and mutation routes with `sameOrigin` loopback checks; cross-origin CSRF attack rejection before normalization; cross-site fetch metadata rejection; untrusted Host rejection; unauthenticated request rejection; direct loopback passthrough; real-DSH WebServer structure without handle method; multiple plugins registering diverse routes; query parameter handling; other HTTP methods; error bubbling; and lifecycle cleanup/restoration); header parsing (exact, off-by-one, empty, missing, absent headers, array, non-string, duplicate, joined, `Headers` case-insensitivity); configuration failures (missing/empty/short/comma/whitespace/non-ASCII secret, missing `ctx.effect`, missing service, missing methods, non-extensible service, undecoratable method with rollback, a mutation that landed but failed verification, and rollback when `ctx.effect` fails); the startup semantic invariant; lifecycle (install, exact-shape restore for inherited and own methods, apply→cleanup→apply, overlapping activations, cross-generation global-marker unwrap, `authenticatedUrl` untouched, no secret in logs). ## Integration tests — 37 passed, 0 failed `npm run test:integration` boots the real Harness Web server with this plugin loaded next to `@deepseek-ai/dsh-client-connection` and asserts: ``` == profile setup (isolated DSH_HOME) == ok dsh plugin add links this checkout and reconciles bundles ok dump-config loads dsh-trusted-proxy-auth ok dump-config still loads @deepseek-ai/dsh-client-connection == index route (/): trusted-proxy authentication == ok no proxy header -> 401 native authentication ok wrong proxy header -> 401 ok valid proxy header -> 200 ok valid proxy header serves the HTML application ok valid proxy header injects ownsHost bootstrap into index HTML ok valid proxy header + untrusted Host -> 403 ok untrusted Host 403 body is minimal ok untrusted Host 403 sets no-store ok valid proxy header + cross-site fetch metadata -> 403 == /api route: request-trust fence is not bypassed == ok /api without proxy header -> 401 ok /api with valid proxy header reaches the application (not 401/403) ok /api cross-origin with valid secret -> 403 ok /api cross-site with valid secret -> 403 ok /api untrusted Host with valid secret -> 403 == WebSocket /api/remote.mux == ok ws without proxy header -> 401 ok ws wrong proxy header -> 401 ok ws valid proxy header + trusted Host -> upgraded ok ws valid proxy header + same Origin -> upgraded ok ws valid proxy header + untrusted Host -> 403 ok ws valid proxy header + wrong Origin -> 403 == native DSH authentication regression (no proxy header) == ok native ?token= exchange -> 303 ok native token exchange mints a session cookie ok native session cookie -> 200 ok native session cookie does not inject proxy ownsHost bootstrap ok invalid native token -> 401 ok native cookie is authority-bound (evil Host -> 401) == log hygiene == ok captured server output never contains the secret ok server stopped cleanly == fail-closed activation == ok missing secret -> non-zero exit ok missing secret -> names the plugin and variable ok missing secret -> no listener ok short secret -> non-zero exit ok short secret -> no listener == filesystem hygiene == ok secret never written under DSH_HOME PASS: 37 passed, 0 failed ``` ## Startup semantic invariant `requestRejection` shape is checked, but so is its meaning. Before decorating anything, activation calls the original, undecorated method with four credential-free probe requests and requires: | Probe | Required result | | --- | --- | | `host: 127.0.0.1`, no credentials | `401` (native browser auth missing) | | `host: dsh-proxy-probe-