operator-docs-editing / member-docs-editing: the WOPI endpoint sits BEHIND the front door's forward_auth, so Collabora reads the sign-in page instead of CheckFileInfo JSON — and video's OIDC callback fails on a response_mode kanidm refuses #1624
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1624
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Drive
20260919T042605Z(artifacts/verdict.json: 39 legs, 35 green, 4 red) carries TWO independent substantive defects. The healer fixed only the harness selector that was MASKING the second one (SSO_BUTTONS, commitdd782cc); neither product defect below is fixed.Defect 1 — docs-editing: the WOPI callback is gated (the named red leg)
operator-docs-editingandmember-docs-editingboth red with:What the box said
coolwsd's own journal on the kept droplet (
journalctl -u coolwsd):Replaying that exact GET on the box (the one narrow read-only replay the healer lane allows) names the HTML:
It is the front door, not Nextcloud and not the WOPI allow-list (
507ff9e4/ GOTCHAS #265 fixed that one, and it is genuinely fixed — the editor frame reaches coolwsd, which serves/browser/25.04.9.4/*before failing). coolwsd is a server-side daemon carrying a per-open WOPIaccess_token, never a community session cookie — soforward_auth401s it, the route'shandle_response302s it to/authz/signin, and coolwsd parses the sign-in HTML as JSON and calls it "Access denied".The defective line
internal/clan/files.go:99-105—FilesExemptPathscarries no richdocuments WOPI entry:The box's rendered Caddyfile confirms the list reaches the door verbatim (
/etc/caddy/caddy_config:137):This is the exact shape of #790 (the suspend reconciler followed the same 302 into
/authz/signinand died on the leading<in an OCS JSON parse), documented atinternal/clan/files.go:86-98— and richdocuments' WOPI controller is the same credential-governed class:@PublicPage, no session, authorised solely by the token Nextcloud minted for that open.Why the healer refused it (refusal rule 3)
This is a front-door trust-boundary decision, not a mechanical repair, so it was not taken in-lane or on the fast lane — the fast lane explicitly excludes security/trust content. Two real doors exist and a human should pick one:
/index.php/apps/richdocuments/wopi*(and possibly the rewrite-form/apps/richdocuments/wopi*) toFilesExemptPaths, beside/ocs/v1.php/cloud/users*. Public, token-governed. Narrow, but it does open a new session-less subtree atfiles.<apex>.wopi_callback_urlat the loopback/mesh target (NextcloudLoopbackTarget,internal/clan/files.go:144) so coolwsd never traverses Caddy. This then requires widening Collabora'sstorage.wopiallow-list (internal/clan/docsediting_attach.go:40), which today pinsfiles.<apex>alone — and it behaves differently for a co-hosted vs. a standalone files node.Whichever is ruled, the accompanying render test belongs beside
TestRenderDocsEditing_WOPICoupledToFilesOnly(internal/clan/docsediting_test.go:44) and the files exempt-path tests. Note the drive is the only end-to-end proof and it is a paid event — a wrong-shaped exemption costs another full drive, which is part of why this wants a ruling rather than a guess.Defect 2 — video: kanidm refuses the plugin's
response_mode, and the callback dies after a successful token exchangeoperator-video/member-videored'd in the drive as "showed its OWN login form" — that presentation was the healer's harness bug and is now fixed. Re-walking the same two doors against the kept box with the fix in place lands them athttps://video.roles-proof.idss.nz/login?externalAuthError=true, "Sorry but there was an issue with the external login".What the box said
PeerTube (
journalctl -u peertube):kanidm, same second (
journalctl -u kanidm), forclient_id=video:What that pins down
response_mode=form_post; kanidm calls it invalid, remaps toquery, and warns the tolerance is going away. The plugin therefore configured itself for a POST callback and was handed a GET one.POST /oauth2/token → 200) — so the client id, secret, redirect_uri and PKCE are all correct. This is not a credential or client-registration fault./oauth2/openid/video/userinforequest at all in the window, where the gate's own flow does hit/oauth2/openid/gate-oidc/userinfo→ 200 moments earlier. The plugin dies between a good token response and userinfo.peertube-oidc-plugin.servicelogspeertube-plugin-auth-openid-connect 1.2.0 registered,peertube-oidc.servicelogsSuccessfor every kanidm call,systemctl --failedis empty, and/api/v1/configreports the external auth registered with"authDisplayName":"Community sign-in".Suspected layer
The OIDC client settings PUT at
internal/clan/video.go:630-641setsscope,discover-url,client-id,client-secret,username-property,mail-property,display-name-property,role-property,auth-display-name— it does not set anything governing response mode, and the claim/scope maps atinternal/clan/video.go:605-613are correct and applied. So the mismatch is between the plugin's ownresponse_mode=form_postdefault and what kanidm will honour. Needs a ruling on the fix's shape: a plugin setting we do not currently set, a kanidm-side client attribute, or a plugin version — none of which is a mechanical repair, and none provable without a drive.Not a defect
The harness is behaving correctly in both cases.
openCollaboraDocument(app/tests/e2e/fixtures/roleDoors.ts:282-360) deliberately treats a drawn-but-refused editor as red — the comment at :299 records that exact false green from run 3 of #1620 — and it caught this one honestly. Do not weaken it.drive
20260919T042605Zred atoperator-docs-editing:docs-editing: proof-operator's document /roles-proof-1789795850019.odt (file 84) was REFUSED by the editor — "Document loading failed — Keyboard navigation help Skip to app navigation Skip to mainevidence:
/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260919T042605Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 — veto anytime. Standing session on matou-workstation, attempt 1. Routing to
ready-for-human: no code landed, and here is exactly why.Both defects in this ticket are honestly diagnosed already (the healer's box evidence holds up on re-reading), but neither is a two-way door I may take. ADR 0174 rule 1 lets a session act only on a decision that is (a) revertible, (b) provable by an existing test/drive/probe, and (c) not on the one-way-door list. Each defect fails on both (b) and (c):
Why human
Defect 1 — docs-editing WOPI callback gated behind
forward_authOne-way door: a security-posture widening (ADR 0174 rule 3, the #329 class). Both viable fixes loosen a trust boundary at the community's only public face:
/index.php/apps/richdocuments/wopi*(and the rewrite-form/apps/richdocuments/wopi*) toFilesExemptPaths(internal/clan/files.go:99). This opens a new session-less subtree atfiles.<apex>, authorised only by the per-open WOPI query-stringaccess_tokenNextcloud mints — a weaker credential class than the existing exempt paths (DAV/OCS use HTTP basic auth Nextcloud refuses without). Structurally it is #790's sibling (a@PublicPage, token-governed controller that follows the door's 302 into the sign-in HTML and mis-parses it as JSON), which argues narrow consistency repair — but the query-token surface is a genuine trust delta, so it wants a ruling, not a session's guess.wopi_callback_urlatNextcloudLoopbackTarget(internal/clan/files.go:140) so coolwsd never traverses Caddy. This then widens Collabora'sstorage.wopiallow-list (internal/clan/docsediting_attach.go, which today pinsfiles.<apex>alone) and behaves differently co-hosted vs. standalone.Proof gap: the ticket is explicit that a drive is the only end-to-end proof and it is a paid event — non-routine spend, itself a one-way door. A render test would prove "we emit the exempt path/allow-list entry" but not that Collabora then loads the document; a wrong-shaped exemption burns a full paid drive.
Proposed default ruling (for the digest): take Option 1, narrowest form — add
/index.php/apps/richdocuments/wopi*beside/ocs/v1.php/cloud/users*inFilesExemptPaths, with the same "credential-governed, NOT a blanket subtree" comment #790 carries, and a render test besideTestRenderDocsEditing_WOPICoupledToFilesOnly/ the files exempt-path tests. Reasons: it is the smaller diff, it mirrors the settled #790 precedent for a token/credential-governed controller, and it avoids the co-host-vs-standalone branching Option 2 introduces. The token is validated by Nextcloud on every CheckFileInfo, so the exemption does not make anything genuinely unauthenticated. If Ben rules Option 1, a session can then land it + the render test as a two-way door and the next scheduled drive proves it.Defect 2 — video OIDC callback dies on a
response_modekanidm refusesOne-way door / proof gap: the fix shape needs a ruling AND is provable only by a paid drive. The diagnosis narrows the direction hard: kanidm fundamentally refuses
form_post("Invalid response mode form_post requested … Remapping to query … WILL BE REMOVED"), so a kanidm-side attribute cannot help — the fix must get the plugin offform_postand ontoresponse_mode=query. The token exchange already succeeds (POST /oauth2/token → 200), so client-id/secret/redirect_uri/PKCE are all correct; the plugin dies between a good token response and userinfo because it configured itself for a POST callback and was handed a GET one.What I could NOT determine here: whether
peertube-plugin-auth-openid-connect1.2.0 exposes a settings key that switches the response mode. The plugin is fetched into the closure by hash (ADR 0257,internal/clan/video.go:129), so its settings schema is not on disk to inspect, and the settings PUT atinternal/clan/video.go:630-641sets nothing governing response mode today. So the mechanism is one of: (a) a plugin settings key we do not currently PUT, (b) a plugin version bump whose default matches kanidm's query mode, or (c) a small vendored patch to the closure plugin. All three are revertible, but none is render-provable — a settings key we invent could be silently ignored and still render-pass, then drive-fail.Proposed default ruling (for the digest): authorise a session to (1) read the 1.2.0 plugin source (framagit,
internal/clan/video.go:116) to find whether a response-mode/response-type/use-pkce-adjacent setting exists, (2) if it does, add it to the settings PUT with a render test, and (3) confirm on the next video-carrying paid drive — bundling it with Defect 1's drive so the trust-boundary ruling and this one are proven in one paid event, not two.Not touched (correct as-is): the harness.
openCollaboraDocumenttreating a drawn-but-refused editor as red (app/tests/e2e/fixtures/roleDoors.ts:299) caught Defect 1 honestly — the run-3 #1620 false-green comment records exactly why it must stay. TheSSO_BUTTONSselector fix (dd782cc) that unmasked Defect 2's presentation is genuine and stays.No
STATUS.mdchange: no project state moved (no gate passed, no artifact added). The ticket now waits on Ben for two one-way-door rulings, batched per ADR 0174 rule 6.Ruled and landed. Ben ruled option 1 in session (2026-09-19): the WOPI callback bypasses the front-door gate, bound to the community's own editor. Landed
5f1dcfb1with ADR 0258 — a NEW class, source-bound callback paths: a Caddy matcher ofpath /index.php/apps/richdocuments/wopi* /apps/richdocuments/wopi*ANDremote_ip <loopback + the founding's public IP>, rendered only while docs-editing is placed, never folded into the openFilesExemptPaths; a missing sidecar yields loopback alone, no source list renders no bypass (GOTCHAS #272). The binding is in Caddy because Nextcloud behind it has notrusted_proxies.Defect 2 (video) is fixed and LIVE-PROVEN:
89420211(the plugin verifies ES256, GOTCHAS #267) +8a9e4b93(the role claim carries PeerTube's numeric role id, #270) — #1620 run 620260919T143405Zgreen 38/38, frames eyeballed (operator greeted "dear administrator!", member "dear user!").Render- and unit-proven; the docs-editing half is live-unproven until the next #1620 fire (all three services). Closing — a red there files fresh evidence.