Skip to content

deploy/k8s ocp-combined: mount moca-oidc and the installer token, and read the token on the combined profile - #942

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
webchang:pr/i938-combined-oidc-installer
Nov 20, 2026
Merged

pdettori merged 1 commit into
rossoctl:mainfrom
webchang:pr/i938-combined-oidc-installer

Conversation

@webchang

Copy link
Copy Markdown
Member

Summary

On the combined profile, the control plane's credentials volume had no moca-oidc source and no SH_INSTALLER_TOKEN item, and the profile didn't read the installer token at all. So a combined deployment with SBX_IDENTITY_PROVIDER=oidc had no client-secret file, and the installer bearer that deploy/sbx/setup.sh generates on both profiles never reached the control plane.

What changes

  • deploy/k8s/overlays/ocp-combined/patch-control-plane.yaml: the restated credentials list (the template-store component replaces it) gains the two sources ocp-sbx has: moca-mu1's SH_INSTALLER_TOKEN item and the optional moca-oidc Secret (SH_OIDC_CLIENT_SECRET). A GitHub deployment has no moca-oidc Secret and renders as before.
  • packages/control-plane/src/main.ts: the combined profile reads SH_INSTALLER_TOKEN as the sandbox profile does, through one installerTokenFromEnv (the same 32-character floor), and keeps it distinct from the host tokens. The members routes it admits are served on this profile too, and the router's installer check is profile-agnostic, so nothing else changes.
  • Docs: docs/reference/configuration.md, users-and-roles.md and security-model.md say the token is read on the sandbox and combined profiles. openapi's installerToken scheme still says "(sandbox members API)": that names the API, not the profile, so it's unchanged.
  • Upgrade note (docs/operate/day-2/upgrades.md, linked from the configuration row): on the combined profile, the token setup.sh already generated becomes live at this upgrade; rotate it first if it may have been shared. The note and docs/reference/security-model.md also say the token can grant the admin role (PUT /v1/subjects/{subject}/roles/admin), so it reaches admin powers in one indirect step through that subject's own login: treat it as admin-equivalent. The mount needs the key present, so it shouldn't be deleted.

Why keep it working on combined, rather than generate it only for sandbox: the members routes are served on the combined profile too (routes.ts ~702-710), and setup.sh already generates the token there (:914-935), so the profile was meant to have it. Once this is rolled out, combined accepts the bearer: any combined deployment that already ran the generating setup.sh gains a members-admin credential at the upgrade, which is what the upgrade note says.

Tests

  • deploy/sbx/tests/overlay-combined.test.sh: renders both overlays and checks that the combined control plane mounts the installer token, an optional moca-oidc, and every secret source and key that ocp-sbx's control plane mounts, with the same optional. Before the fix it fails ("the control plane does not mount SH_INSTALLER_TOKEN"); with only the token added and moca-oidc still missing, the comparison alone fails ("ocp-sbx's control plane mounts Secret moca-oidc but the combined one does not"). After: passes; overlay.test.sh still passes.
  • packages/control-plane/test/sandbox-config.test.ts: the combined profile reads the installer bearer and refuses a short one. Fails before (1 of 33), passes after; the control-plane suite passes (2,008, 3 skipped), and tsc --noEmit is clean.

Closes #938

Assisted-By: Claude Code

…-oidc and reads the installer token

ocp-combined restates the control plane's projected credentials list (the
template-store component replaces it), and the restated list missed two
sources ocp-sbx has: the optional moca-oidc Secret and moca-mu1's
SH_INSTALLER_TOKEN item. So an SBX_IDENTITY_PROVIDER=oidc combined deployment
had no SH_OIDC_CLIENT_SECRET file, and the installer bearer setup.sh
generates on both profiles never reached the control plane.

- ocp-combined/patch-control-plane.yaml: add both, as in ocp-sbx.
- main.ts: the combined profile reads SH_INSTALLER_TOKEN as the sandbox
  profile does (installerTokenFromEnv, the same 32-character floor), and keeps
  it distinct from the host tokens; the members routes it admits are served
  on this profile too.
- overlay-combined.test.sh: the combined control plane mounts the installer
  token and an optional moca-oidc, and every secret source and key ocp-sbx's
  control plane mounts (render of both overlays).
- sandbox-config.test.ts: the combined profile reads the installer bearer.
- docs/reference: the installer token is read on the sandbox and combined
  profiles.
- docs/operate/day-2/upgrades.md (and the configuration row): an upgrade
  note that on combined the token setup.sh already generated becomes live.
- docs/reference/security-model.md and the upgrade note: the installer token
  can grant the admin role, so treat it as admin-equivalent.

Closes rossoctl#938

Assisted-By: Claude Code
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 20, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — deploy/k8s ocp-combined: mount moca-oidc and the installer token, and read the token on the combined profile

Both halves of a real gap, and the guard against the next one is the best part of the diff.

  • The overlay restates the combined credentials volume, and that restatement had drifted from ocp-sbx: no SH_INSTALLER_TOKEN item and no moca-oidc source, so an OIDC combined deployment had no client-secret file and the bearer setup.sh generates on both profiles never arrived. Both are added, moca-oidc optional: true so a GitHub deployment renders as before.
  • The combined config now reads the token through the extracted installerTokenFromEnv (same ≥32 check and message as the sandbox profile), adds it to templateHosts' distinctness list so a host token cannot collide with it, and the combined config test pins read/short-refusal.
  • The test: rather than restating the expected keys by hand, overlay-combined.test.sh renders ocp-sbx and asserts every control-plane credential source (name, optionality, every key) is present on combined. That is what would have caught this, and it will catch the next source added to one side only.
  • The security-model and users-and-roles updates are right to call the installer token admin-equivalent — it can grant the role — and the upgrade note's warning to rotate a possibly-shared token before the mount goes live (and to keep a key in place, since the item is not optional) is the correct operational instruction.

CI 18/18. Author: webchang (MEMBER — maintainer).

@pdettori
pdettori merged commit 6b42d41 into rossoctl:main Nov 20, 2026
18 checks passed
@pdettori pdettori added this to the v0.11.0 milestone Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy/k8s ocp-combined: the control plane mounts neither moca-oidc nor the installer token

3 participants