Skip to content

fix: authenticate the dsh web probes with the launch token - #5

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/token-aware-web-probe
Sep 23, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
fix/token-aware-web-probe

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Authenticate the two dsh web-UI probes with the launch token that dsh web
(>= dsh-web-app 0.1.5-rc.x, here @deepseek-ai/dsh 0.1.7-rc.1) now requires.
A tokenless GET / returns 401, so both hard-coded tokenless curl probes
got the auth fence's 401 — the two failing checks in opencharly/pod-dsh's
check-dsh-pod R10 bed. After this change the bed passes end-to-end (see R10).

Per-file change (git diff --numstat origin/main...HEAD, head 5649577):

File +/- What
candy/plugin-dsh/webprobe.go +17/−0 NEW: the single shared dshWebTokenProbe(port) fragment — reads the launch token from $DSH_HOME/web-token, hard-errors on a missing/empty token, and curls http://127.0.0.1:<port>/?token=$T in-box. Used by both call sites (R3).
candy/plugin-dsh/verb.go +10/−6 verbWebRunning uses dshWebTokenProbe("3080").
candy/plugin-dsh/control.go +7/−2 DshStatusCmd.Run uses dsh --version && { dshWebTokenProbe("3080"); } && echo 'web UI: HTTP 200 on 127.0.0.1:3080'.
candy/plugin-dsh/webprobe_test.go +35/−0 NEW: in-tree coverage locking in the token-authenticated shape.
candy/plugin-dsh/charly.yml +12/−5 dsh-cli-skill prose: the web-running and status bullets + the candy description state the token semantics.

Why: dsh-web-app 0.1.5-rc.x mints a random per-process launch token and prints
it in its dsh web: http://127.0.0.1:3080/?token=... readiness line; the dsh
candy's entrypoint captures it to $DSH_HOME/web-token. There is no flag or
config that disables authentication. The probes must authenticate with it. curl -f accepts the token exchange's 303 (no -L needed).

Relates to: opencharly/pod-dsh#3 (the relocated check-dsh-pod bed that
exercises these two probes).

How tested

All commands run in candy/plugin-dsh with GOWORK=off, on the final tree
(head 5649577).

$ gofmt -l .
(empty)
$ go build ./...
BUILD OK
$ go vet ./...
VET OK
$ go test ./...
ok  	github.com/opencharly/plugin-dsh/candy/plugin-dsh	0.024s
?   	github.com/opencharly/plugin-dsh/candy/plugin-dsh/cmd/serve	[no test files]
?   	github.com/opencharly/plugin-dsh/candy/plugin-dsh/params	[no test files]

R10 — the disposable check-dsh-pod bed passes with this plugin compiled in

  • Disposable target: the check-dsh-pod pod (disposable: true, lifecycle: dev) in opencharly/pod-dsh, driven by the pod's own working tree (CHARLY_REPO_OVERRIDE="github.com/opencharly/pod-dsh=/tmp/opencode/rem-dsh-6,...").
  • Fresh-rebuild confirmation: the bed ran charly update (step update PASS), then re-ran the live checks (check-live-rebuild PASS) — i.e. proven again after a fresh rebuild, not just at first boot.
  • How this plugin is compiled in: a scratch build of the charly dev tree (/tmp/opencode/charly-now/charly) with a go.work replace github.com/opencharly/plugin-dsh/candy/plugin-dsh => <this branch's candy/plugin-dsh> — so the compiled-in command:dsh + verb:dsh providers ARE this branch. Verified in the binary: strings … | grep -c "no dsh web token" = 1 and grep -c "curl -fsS -o /dev/null http://127.0.0.1:3080/" = 0 (the tokenless probe is gone).
$ charly check run check-dsh-pod
charly check run check-dsh-pod: [image-build] PASS after 1m26.288s [allowlisted=1 cache=139/150]
charly check run check-dsh-pod: [check-image] PASS after 40.35s [allowlisted=1]
charly check run check-dsh-pod: [deploy-add] PASS after 5.287s [allowlisted=1]
charly check run check-dsh-pod: [config] PASS after 5.831s [allowlisted=1]
charly check run check-dsh-pod: [start] PASS after 4.663s [allowlisted=1]
charly check run check-dsh-pod: [bring-up-members] PASS after 163ms
charly check run check-dsh-pod: [check-live] PASS after 46.946s [allowlisted=1]
charly check run check-dsh-pod: [feature-run] PASS after 27.52s [allowlisted=1]
charly check run check-dsh-pod: [update] PASS after 23.795s [allowlisted=5]
charly check run check-dsh-pod: [rebuild-ready] PASS after 2.681s
charly check run check-dsh-pod: [check-live-rebuild] PASS after 45.098s [allowlisted=1]
charly check run check-dsh-pod: [feature-run-rebuild] PASS after 25.792s [allowlisted=1]
charly check run check-dsh-pod: [cleanup] PASS after 20.58s [allowlisted=1]
charly check run check-dsh-pod: [cleanup-members] PASS after 0s
charly check run check-dsh-pod: PASS (steps=14)

# .check/check-dsh-pod/2026.266.2311/summary.yml  (verbatim, tail)
total_seconds: 335
diagnostics:
  errors: 0
  warnings: 0
  advisories: 0
  allowlisted: 15
  errors_fatal: true
  warnings_fatal: false
  advisories_fatal: false
  cache_hits: 139
  cache_steps: 150
ok: true

The two previously-failing checks now pass, alongside every other check-live
step (36 steps: 35 passed, 0 failed, 1 skipped):

  PASS  check the dsh version verb reports the dsh version in-box  [dsh-verb-version]  dsh 0.1.7-rc.1
  PASS  check the dsh web-running verb probes the web UI in-box  [dsh-verb-web-running]  dsh web UI answers on 127.0.0.1:3080 with the launch token
  PASS  check the dsh profile-list verb lists the profiles in-box  [dsh-verb-profile-list]  web
  PASS  check the dsh plugin-list verb lists the web profile's plugins in-box  [dsh-verb-plugin-list]  dsh plugin-list: exit=0
  PASS  check the compiled-in charly dsh status command reaches the deployed box over the reverse channel  [dsh-cmd-status]  exit=0
36 steps: 35 passed, 0 failed, 1 skipped

Coverage that fails without the change

webprobe_test.go asserts the probe reads "${DSH_HOME:-$HOME/.dsh}/web-token",
authenticates with http://127.0.0.1:<port>/?token=$T, errors with
no dsh web token on a missing token, and contains NO tokenless
127.0.0.1:3080/" request — so a regression to the tokenless probe fails
go test. The candy workflow (build job, this PR) also passed:
charly box validate green at the CI pin v2026.238.1242.

Rulebook compliance

  • R1 (RCA): root-caused the bed failures to the auth fence introduced in
    dsh-web-app 0.1.5-rc.x; the probes were tokenless by construction.
  • R2 (no out-of-scope): the fix is confined to the two probes that own the
    behavior; the schema-stamp alignment to the CI pin is owned by the repo's
    schema-migration batch (root manifest already at 2026.232.0520, accepted by
    the pinned CI binary — build check PASS).
  • R3 (no duplication): one shared dshWebTokenProbe(port) fragment
    (webprobe.go), not a second copy — the earlier verbatim duplication at both
    call sites is removed.
  • R4 (no workarounds): no retries/sleeps/tokenless fallback; a missing token
    is a hard, explicit error.
  • R5 (delete legacy): the tokenless probe is removed at both sites, not kept
    behind a fallback.
  • R6 (git safety): branch fix/token-aware-web-probe, no force-push.
  • R0: skills loaded (git-workflow, plugin); collision preflight: the only
    open PR (feat(plugin-dsh): adopt spec 261 (schema-head pin bump) #4, feat/schema-261) touches go.mod/go.sum only — no overlap.
  • R10: the check-dsh-pod bed PASSES end-to-end (14 steps) with this plugin
    compiled in, including the fresh-rebuild check-live-rebuild pass.

Change classification

  • Change class: charly-or-sdk Go (plugin provider runtime + skill prose).
  • Verification gate: gofmt -l . / go build ./... / go vet ./... /
    go test ./... green; the disposable check-dsh-pod bed run to a fresh
    rebuild with this plugin compiled in — PASS.
  • Attribution tier: fully tested and validated — the full R10 gate passed
    on the final tree, and the changed runtime paths (dsh-verb-web-running,
    dsh-cmd-status) executed live.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

dsh-web-app >= 0.1.5-rc.x (dsh 0.1.7-rc.1) authenticates every web UI
request: each process mints a random launch token and a tokenless GET /
returns 401. The plugin-dsh probes hard-coded tokenless curl requests to
http://127.0.0.1:3080/, so on the current dsh they get the auth fence's
401 — the two failing checks in pod-dsh's check-dsh-pod bed.

- verb.go verbWebRunning: read the token the dsh candy's entrypoint
  persists to $DSH_HOME/web-token and probe ?token=<token>; a missing
  token file is a hard error, never a silent tokenless probe.
- control.go DshStatusCmd.Run: same authenticated probe after dsh
  --version.
- charly.yml: state the token semantics in the dsh-cli-skill prose.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: e280f49ca27c7d50616622e3908bddec4f87123f (branch: fix/token-aware-web-probe)

Change class: code/config — plugin Go runtime (candy/plugin-dsh/verb.go, control.go) + skill prose (charly.yml).

Comment thread: 0 comments — nothing to adjudicate.

Blocks

  1. A2 / B12 (R10) — the required bed was never run. This is a runtime/code change, so its gate is a FRESH-rebuild bed run with pasted output. The body itself proves the R10 bed check-dsh-pod (dsh-verb-web-running, dsh-cmd-status) still fails (33 passed, 2 failed, 1 skipped) and was not run green against a charly build containing this plugin. "The end-to-end check-dsh-pod bed pass requires this plugin compiled into a charly build (the cross-repo prerequisite)" is a deferral, not proof — the plugin can be built into a charly build and the bed run from this branch; rule 3 (self-gating install) does not apply because this PR is not the gate it gates. Run the bed and paste the green output (verb.go:72-74, control.go:63-65).

  2. A1 — "How tested" is incomplete for the class. For a runtime change the block must name the disposable target and the fresh-rebuild confirmation; it names neither. Its only automated evidence is go test ./..., which reports [no test files] for every package — a bare go test cannot stand in for a bed run (explicitly fraud per A2). Supply the fresh-rebuild bed evidence, not gofmt/build/vet/test.

  3. B14b / B6 (R2) — forbidden "pre-existing" framing. "That mismatch is pre-existing and independent of this diff" parks the charly box validate gap without naming the batch/task this PR advances. A parking phrase with no named exit is itself the R2 split.

  4. B12 — the new behavior ships no coverage in the diff. The token-read + authenticated-probe path is new behavior with no test/hook in the diff that would fail without it; the repo has no test files at all, so nothing in-tree proves it. State where the failing-without-it coverage lives and that it was actually executed, or add it.

  5. B7 (R3) — duplicated block. The token-read guard + authenticated curl is copy-pasted verbatim at verb.go:72-74 and control.go:63-65. The body concedes "the same shape in both call sites"; a shared helper (both files are in the same package) is the expected fix, not a second copy.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

aitrawog pushed a commit to opencharly/pod-dsh that referenced this pull request Sep 23, 2026
…ecks

dsh-web-app 0.1.7-rc.1 authenticates every web UI request: each process
mints a random launch token and a tokenless GET / returns 401. Bump the
pinned @deepseek-ai/dsh to 0.1.7-rc.1 (which also fixes the 0.1.0-rc.6
Cordis-HMR boot crash), capture the launch token from dsh web's readiness
line to $DSH_HOME/web-token in the entrypoint, and authenticate every
in-box web probe with ?token=<token>.

- package.json: @deepseek-ai/dsh 0.1.0-rc.6 -> 0.1.7-rc.1.
- dsh-entrypoint: run dsh web to a log, parse the token= readiness line,
  persist it to $DSH_HOME/web-token (on the dsh volume), then exec socat.
- charly.yml: token-aware in-box checks (dsh-web-token / dsh-web-inbox /
  dsh-web-published) and a 401 auth-fence check on the published port.

The two plugin-dsh-owned probes (dsh-verb-web-running, dsh-cmd-status)
still fail until opencharly/plugin-dsh#5 lands.
Address the validator's R3 (the token-read + authenticated curl was
copy-pasted at both call sites) and coverage blocks:

- webprobe.go: one shared dshWebTokenProbe(port) fragment used by both
  verbWebRunning and DshStatusCmd.Run.
- webprobe_test.go: locks in the token-authenticated shape (reads the
  token file, authenticates with ?token=$T, errors on a missing token,
  targets the requested port) — fails on a regression to the tokenless
  probe.
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 56495776dccca0b535b569ff897af7e343abfe6b (branch: fix/token-aware-web-probe)

Security screen: PASS — no secrets/egress (probe targets loopback only), no guardrail/rulebook/branch-protection weakening, no supply-chain or schema-source edits; placement CORRECT (capability stays in the candy).
Checklist: All applicable rules PASS or NA.
Comment intake: 1 comment (github-actions[bot] BLOCK @ e280f49) — all five findings stale-superseded against the current head 5649577: the probe is now a single shared dshWebTokenProbe used by both sites (B7/R3), webprobe_test.go ships failing-without-it coverage (B12), and the body pastes the disposable check-dsh-pod fresh-rebuild bed run with disposable target named (A1/A2/B12); the quoted "pre-existing and independent of this diff" text no longer appears in the body.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 23, 2026 23:21
@github-actions
github-actions Bot merged commit 819f6f9 into main Sep 23, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 23, 2026
aitrawog pushed a commit to opencharly/pod-dsh that referenced this pull request Sep 23, 2026
opencharly/plugin-dsh#5 merged (squash 819f6f9); dsh-verb-web-running and
dsh-cmd-status pass once the plugin is compiled into the bed's charly
build. Replace the stale 'until it lands' comment.
github-actions Bot pushed a commit to opencharly/pod-dsh that referenced this pull request Sep 23, 2026
…are dsh) (#4)

* feat: relocate check-dsh-pod bed from opencharly/charly

Move the dsh-app box + check-dsh-pod R10 bed into the candy's owning repo.
A bed in opencharly/charly cannot exercise this candy as in-development
code: the check-bed runner's dev-tree override
(SelfSuperprojectOverridePair) points the bed project's OWN superproject's
@github refs at the local tree, and a candy owned by another repo is never
covered by it. Locally here the box composes the local `dsh` candy with no
@github pin, so a bed run always tests this checkout.

The box needs an npm builder. The canonical fedora builder chain is
FLAT-IMPORTED (the three box files fedora / fedora-nonfree / fedora-builder)
rather than the distro-fedora NAMESPACE: the namespace drags in that repo's
charly-marketplace candy, which references the remote opencharly/pod-dsh
whose candy is ALSO named `dsh`, shadowing this project's local `dsh`. The
flat import also gets the RPM Fusion chain (fedora-nonfree) that
build-toolchain needs for its codec-devel packages (ffmpeg-devel /
x264-devel) — a locally declared minimal builder without rpmfusion failed
the image build (`No match for argument: ffmpeg-devel`).

The receiving config is migrated to the current schema head, given a
defaults.build, and the candy CI pin bumped (v2026.238.1242 ->
v2026.256.1316). A standard .gitignore keeps the bed's .check/ scratch and
.build/ artifacts out of the tree.

R10: `charly check run check-dsh-pod` PASS (steps=14, 566s) — image-build,
check-image, deploy, check-live, the dsh: verbs, fresh update,
check-live-rebuild all green, teardown clean. Verdict: repo override active
(CHARLY_REPO_OVERRIDE=github.com/opencharly/opencharly=...) — about the LOCAL
tree.

`charly box validate`: OK — checked 11 candies, 4 boxes, 1 deploy, 7 distros,
7 builders; 0 warnings, 0 errors.

Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)

* docs: re-freeze the PR body

* docs: reconcile the schema stamp with the CI pin in the PR body

* fix(dsh): capture the web launch token and authenticate the in-box checks

dsh-web-app 0.1.7-rc.1 authenticates every web UI request: each process
mints a random launch token and a tokenless GET / returns 401. Bump the
pinned @deepseek-ai/dsh to 0.1.7-rc.1 (which also fixes the 0.1.0-rc.6
Cordis-HMR boot crash), capture the launch token from dsh web's readiness
line to $DSH_HOME/web-token in the entrypoint, and authenticate every
in-box web probe with ?token=<token>.

- package.json: @deepseek-ai/dsh 0.1.0-rc.6 -> 0.1.7-rc.1.
- dsh-entrypoint: run dsh web to a log, parse the token= readiness line,
  persist it to $DSH_HOME/web-token (on the dsh volume), then exec socat.
- charly.yml: token-aware in-box checks (dsh-web-token / dsh-web-inbox /
  dsh-web-published) and a 401 auth-fence check on the published port.

The two plugin-dsh-owned probes (dsh-verb-web-running, dsh-cmd-status)
still fail until opencharly/plugin-dsh#5 lands.

* docs: the plugin-dsh token fix has landed; correct the bed comment

opencharly/plugin-dsh#5 merged (squash 819f6f9); dsh-verb-web-running and
dsh-cmd-status pass once the plugin is compiled into the bed's charly
build. Replace the stale 'until it lands' comment.

* docs: re-freeze the PR body against the final head

Body-only fix (R8 tag-vs-candy-version reconciliation); the empty commit
gives the validator a fresh head whose body is already final.

---------

Co-authored-by: Andreas Trawoeger <[email protected]>
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Sep 24, 2026
Bump github.com/opencharly/plugin-dsh/candy/plugin-dsh v0.2026237.1419 -> v0.2026266.2321 (the merged tag of opencharly/plugin-dsh#5). verbWebRunning + DshStatusCmd.Run now read $DSH_HOME/web-token and authenticate with ?token=<token>.

go mod tidy updates go.sum. The charly binary builds green and its module buildinfo carries the new pin; the compiled-in probe string (web-token / ?token=$T) is present in the binary.

R10 (live, charly rebuilt against the bumped pin):
- check-dsh-pod: PASS (steps=14); dsh-verb-web-running and dsh-cmd-status PASS pre- and post-rebuild.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: Andreas Trawoeger <[email protected]>
@aitrawog
aitrawog deleted the fix/token-aware-web-probe branch September 25, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants