video sign-in: the closure-pinned plugin 1.2.0 hardcodes response_mode=form_post, which kanidm only tolerates by a remap it says WILL BE REMOVED — a future kanidm bump breaks video sign-in #1626

Closed
opened 2026-09-19 13:10:24 +00:00 by ben · 3 comments
Owner

The hazard (not red today)

Seen on the #1620 roles-proof kept box (run 4, 20260919T042605Z) by the #1620 session: kanidm logs a warning that the video client's authorisation request carries an invalid response_mode=form_post, that it is remapping it to query, and that this tolerance "WILL BE REMOVED in a future release".

peertube-plugin-auth-openid-connect 1.2.0 hardcodes form_post (dist/main.js:232). Since ADR 0257 (c92ca62f) that exact version is pinned into the closure (videoOIDCPluginVersion, internal/clan/video.go), and 2.x needs PeerTube >= 8.3.0 (the pin is 8.1.8) — so the plugin cannot simply be bumped today.

What breaks, and when

Nothing now. On the kanidm release that drops the remap, every video community sign-in fails at the authorise step. It will arrive through a nixpkgs bump, silently, unless a drive with a video sign-in leg runs on that bump first (#1620's harness has one).

Options (for whoever picks this up)

  1. When nixpkgs carries PeerTube >= 8.3.0: re-pin the plugin to 2.x if 2.x no longer sends form_post (check its source first) — version + four hashes, the ADR 0257 re-pin.
  2. Patch the pinned 1.2.0 in the module's runCommand (a one-line substituteInPlace on dist/main.js) — cheap now that the plugin is built in the closure; needs the callback route checked for query-mode handling.
  3. Pin kanidm below the removal until 1 or 2 lands.

Source: cross-session note from the #1620 lane, 2026-09-19. Related: ADR 0257, #1616, #1544, spec #1535.

## The hazard (not red today) Seen on the #1620 roles-proof kept box (run 4, `20260919T042605Z`) by the #1620 session: kanidm logs a warning that the video client's authorisation request carries an invalid `response_mode=form_post`, that it is remapping it to `query`, and that this tolerance **"WILL BE REMOVED in a future release"**. `peertube-plugin-auth-openid-connect` **1.2.0** hardcodes `form_post` (`dist/main.js:232`). Since ADR 0257 (`c92ca62f`) that exact version is pinned into the closure (`videoOIDCPluginVersion`, `internal/clan/video.go`), and 2.x needs PeerTube >= 8.3.0 (the pin is 8.1.8) — so the plugin cannot simply be bumped today. ## What breaks, and when Nothing now. On the kanidm release that drops the remap, every video community sign-in fails at the authorise step. It will arrive through a nixpkgs bump, silently, unless a drive with a video sign-in leg runs on that bump first (#1620's harness has one). ## Options (for whoever picks this up) 1. When nixpkgs carries PeerTube >= 8.3.0: re-pin the plugin to 2.x **if** 2.x no longer sends `form_post` (check its source first) — version + four hashes, the ADR 0257 re-pin. 2. Patch the pinned 1.2.0 in the module's `runCommand` (a one-line `substituteInPlace` on `dist/main.js`) — cheap now that the plugin is built in the closure; needs the callback route checked for query-mode handling. 3. Pin kanidm below the removal until 1 or 2 lands. **Source:** cross-session note from the #1620 lane, 2026-09-19. **Related:** ADR 0257, #1616, #1544, spec #1535.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: ready-for-agent, take option 2 (patch the pinned 1.2.0 in the closure now)

Category bug (a latent product defect: a future kanidm bump silently breaks every video community's sign-in). State ready-for-agent — this is a code change to internal/clan/video.go, no design contract or host standing needed.

Why option 2 and not 1 or 3:

  • Option 2 (a one-line substituteInPlace on dist/main.js in the plugin's runCommand, internal/clan/video.go:156) closes the hazard now, cheaply, while the plugin is already built in the closure (ADR 0257). Option 1 (re-pin to 2.x) is blocked on nixpkgs carrying PeerTube ≥ 8.3.0 — the hazard stays latent indefinitely. Option 3 (pin kanidm below the removal) freezes a security-relevant component to work around a plugin bug — the higher-regret path.
  • This is a two-way door. Revertible: when nixpkgs advances, a later commit re-pins to 2.x (option 1) and drops the patch. Provable: #1620's roles-proof harness has a video sign-in leg that exercises the authorise→callback hop end to end.
  • Not on the one-way-door list. response_mode=query is the OAuth2 default for an authorization-code flow (the code returns in the query, single-use, exchanged over the back channel — not a token in the URL). Critically, kanidm already remaps this request to query today, so the plugin's callback already receives and handles the query-mode response on every live sign-in — this patch makes explicit what already happens, so it is not a security-posture widening.

Agent brief

Goal: stop the closure-pinned peertube-plugin-auth-openid-connect 1.2.0 from sending response_mode=form_post, so video sign-in survives the kanidm release that drops the form_post→query tolerance.

Where: internal/clan/video.go. The plugin is built into the closure by a pkgs.runCommand at video.go:156 (videoOIDCPlugin, version const at :105). 1.2.0 hardcodes form_post at dist/main.js:232.

Do:

  1. In the plugin's runCommand, add a substituteInPlace dist/main.js (or an equivalent sed/patch step over the unpacked tarball) that changes the hardcoded response_mode=form_post to query (or removes the response_mode param so PeerTube/the IdP default to query). Read dist/main.js:232 in the vendored tarball first to get the exact literal.
  2. Verify the callback handles query mode before landing. It does today — kanidm already remaps to query, so the current live callback receives the code in the query string. Confirm the plugin's redirect/callback route reads the code from the query (not only a POST body). If it does not, stop and report on the ticket rather than shipping a break.
  3. Pin the behaviour with a render test in the TestRenderVideo_* family (internal/clan/video_test.go) — assert the built plugin's main.js no longer contains form_post (or the runCommand carries the substitution). Keep the sha512 integrity/hash discipline intact (a substituteInPlace inside runCommand operates on the already-fetched, hash-verified tarball, so the tarball hash at :129 is unchanged).

Definition of done: go test ./internal/clan green; the render test proves form_post is gone from the built plugin; the change is drive-proven by the next #1620 video sign-in leg (the authorise step no longer logs the kanidm form_post remap warning). Leave a note re-pointing at option 1 as the eventual replacement once nixpkgs carries PeerTube ≥ 8.3.0 and 2.x is confirmed to drop form_post.

Related: ADR 0257, #1616, #1544, #1620, spec #1535.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Ruling: `ready-for-agent`, take **option 2** (patch the pinned 1.2.0 in the closure now) Category `bug` (a latent product defect: a future kanidm bump silently breaks every video community's sign-in). State `ready-for-agent` — this is a code change to `internal/clan/video.go`, no design contract or host standing needed. **Why option 2 and not 1 or 3:** - **Option 2** (a one-line `substituteInPlace` on `dist/main.js` in the plugin's `runCommand`, `internal/clan/video.go:156`) closes the hazard *now*, cheaply, while the plugin is already built in the closure (ADR 0257). Option 1 (re-pin to 2.x) is blocked on nixpkgs carrying PeerTube ≥ 8.3.0 — the hazard stays latent indefinitely. Option 3 (pin kanidm below the removal) freezes a security-relevant component to work around a plugin bug — the higher-regret path. - **This is a two-way door.** Revertible: when nixpkgs advances, a later commit re-pins to 2.x (option 1) and drops the patch. Provable: #1620's roles-proof harness has a video sign-in leg that exercises the authorise→callback hop end to end. - **Not on the one-way-door list.** `response_mode=query` is the OAuth2 default for an authorization-**code** flow (the code returns in the query, single-use, exchanged over the back channel — not a token in the URL). Critically, kanidm **already** remaps this request to `query` today, so the plugin's callback already receives and handles the query-mode response on every live sign-in — this patch makes explicit what already happens, so it is **not** a security-posture widening. ## Agent brief **Goal:** stop the closure-pinned `peertube-plugin-auth-openid-connect` 1.2.0 from sending `response_mode=form_post`, so video sign-in survives the kanidm release that drops the `form_post`→`query` tolerance. **Where:** `internal/clan/video.go`. The plugin is built into the closure by a `pkgs.runCommand` at `video.go:156` (`videoOIDCPlugin`, version const at `:105`). 1.2.0 hardcodes `form_post` at `dist/main.js:232`. **Do:** 1. In the plugin's `runCommand`, add a `substituteInPlace dist/main.js` (or an equivalent `sed`/`patch` step over the unpacked tarball) that changes the hardcoded `response_mode=form_post` to `query` (or removes the `response_mode` param so PeerTube/the IdP default to `query`). Read `dist/main.js:232` in the vendored tarball first to get the exact literal. 2. **Verify the callback handles query mode before landing.** It does today — kanidm already remaps to `query`, so the current live callback receives the code in the query string. Confirm the plugin's redirect/callback route reads the code from the query (not only a POST body). If it does *not*, stop and report on the ticket rather than shipping a break. 3. Pin the behaviour with a render test in the `TestRenderVideo_*` family (`internal/clan/video_test.go`) — assert the built plugin's `main.js` no longer contains `form_post` (or the `runCommand` carries the substitution). Keep the `sha512` integrity/hash discipline intact (a `substituteInPlace` inside `runCommand` operates on the already-fetched, hash-verified tarball, so the tarball hash at `:129` is unchanged). **Definition of done:** `go test ./internal/clan` green; the render test proves `form_post` is gone from the built plugin; the change is drive-proven by the next #1620 video sign-in leg (the authorise step no longer logs the kanidm `form_post` remap warning). Leave a note re-pointing at **option 1** as the eventual replacement once nixpkgs carries PeerTube ≥ 8.3.0 and 2.x is confirmed to drop `form_post`. **Related:** ADR 0257, #1616, #1544, #1620, spec #1535.

swarm-claim host=bens-mac-04 run=27528
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=27528 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1626 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1626,
  "status": "success",
  "commits": [
    "ee6f74c234e83be4e4fcefc870e7360444d4fdd8"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/video.go",
    "internal/clan/video_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/clan/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go test ./internal/clan/ -run TestRenderVideo_OIDCPlugin",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Stop the pinned plugin from sending response_mode=form_post": "internal/clan/video.go renderVideoLet: substituteInPlace $out/dist/main.js --replace-fail \"response_mode: 'form_post'\" \"response_mode: 'query'\" added to the closure runCommand; the plugin sends response_mode=query after the closure build",
    "Verify the callback handles query mode before landing": "Inspected 1.2.0 dist/main.js toRequest(): on a GET it returns the currentUrl (which carries the code in the query string) and hands it to openid.authorizationCodeGrant; kanidm already remaps to query today, so the live callback already receives the code in query mode — no callback change needed",
    "Keep the sha512 integrity/hash discipline intact": "The substituteInPlace runs inside runCommand over the already-fetched, hash-verified tarball, so the tarball hash at video.go:129 is unchanged; the four videoOIDCPluginTarballs hashes are untouched",
    "Pin the behaviour with a render test asserting form_post is gone": "internal/clan/video_test.go TestRenderVideo_OIDCPluginQueryResponseMode asserts the runCommand carries the substituteInPlace and that form_post does not survive the closure build",
    "go test ./internal/clan green": "nix develop .#go-ci --command go test ./internal/clan/ exit 0; the full pre-push go-ci gate also passed on push (0 issues)"
  },
  "summary": "The closure build rewrites the video sign-in plugin's hardcoded response_mode=form_post to query, so a future kanidm bump that drops the form_post remap can't silently break community sign-in.",
  "reason": "",
  "blockers": []
}
**close-report** for #1626 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1626, "status": "success", "commits": [ "ee6f74c234e83be4e4fcefc870e7360444d4fdd8" ], "changed_files": [ "STATUS.md", "internal/clan/video.go", "internal/clan/video_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/clan/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go test ./internal/clan/ -run TestRenderVideo_OIDCPlugin", "exit_code": 0 } ], "criteria": { "Stop the pinned plugin from sending response_mode=form_post": "internal/clan/video.go renderVideoLet: substituteInPlace $out/dist/main.js --replace-fail \"response_mode: 'form_post'\" \"response_mode: 'query'\" added to the closure runCommand; the plugin sends response_mode=query after the closure build", "Verify the callback handles query mode before landing": "Inspected 1.2.0 dist/main.js toRequest(): on a GET it returns the currentUrl (which carries the code in the query string) and hands it to openid.authorizationCodeGrant; kanidm already remaps to query today, so the live callback already receives the code in query mode — no callback change needed", "Keep the sha512 integrity/hash discipline intact": "The substituteInPlace runs inside runCommand over the already-fetched, hash-verified tarball, so the tarball hash at video.go:129 is unchanged; the four videoOIDCPluginTarballs hashes are untouched", "Pin the behaviour with a render test asserting form_post is gone": "internal/clan/video_test.go TestRenderVideo_OIDCPluginQueryResponseMode asserts the runCommand carries the substituteInPlace and that form_post does not survive the closure build", "go test ./internal/clan green": "nix develop .#go-ci --command go test ./internal/clan/ exit 0; the full pre-push go-ci gate also passed on push (0 issues)" }, "summary": "The closure build rewrites the video sign-in plugin's hardcoded response_mode=form_post to query, so a future kanidm bump that drops the form_post remap can't silently break community sign-in.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1626
No description provided.