Skip to content

docs(reference): users, enrollment and roles; fix the pages that predate API enrollment - #926

Merged
pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:docs/users-roles
Nov 19, 2026
Merged

pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:docs/users-roles

Conversation

@pdettori

Copy link
Copy Markdown
Member

Summary

This adds a reference page for users, enrollment and roles, and fixes published pages that were staler than the material it came from. It uses the genuinely new parts of the user lifecycle material; about 60% of that material repeats published pages and is linked instead. Everything is corrected against the code; the claim → file:line list is available on request.

New docs/reference/users-and-roles.md, "Users, enrollment and roles":

  • Subjects: github:, oidc: and test:, with an examples table.
  • Who is enrolled and who is an admin: from the settings and from the API-backed members store.
  • Who can change access. This includes the installer token, SH_INSTALLER_TOKEN: a static bearer that acts as a settings admin on the /v1/subjects routes. It's read on the sandbox profile only, must be at least 32 characters, and is compared timing-safe (main.ts:454-458, server.ts:113-129). The source material missed it entirely, and no published page documented it.
  • What a damaged members.json does.
  • Who can log in on each route profile: harness, sandbox and combined.
  • What happens to a departed user's things: refresh families, sandboxes, sandbox tokens, templates and turn grants.
  • Every credential's lifetime, linked to the security model's "Tokens" section.
  • The members record kinds and how to verify them offline.
  • The design limits.

Fixes to stale published pages:

  • security-model.md, harness/concepts/multi-user.md: the admin role no longer comes only from SH_ADMIN_SUBJECTS. API grants, per-request roles, oidc: subjects and the installer token now count too.
  • operate/harness/multi-user.md §6: the admin-rights row is corrected, and "no way to remove a user" now explains why on the harness profile.
  • install.md: the combined profile also counts store enrollment.
  • runbook §4: oidc: subjects alongside github:.
  • oidc-login.md: the profiles are named correctly.
  • configuration.md gains SH_ALLOWED_SUBJECTS, SH_INSTALLER_TOKEN and the SH_SANDBOX_* token, per-subject, lifetime, mode and idle-ceiling settings. SH_SANDBOX_MAX_LIFETIME_SECONDS defaults to the lifetime, and idle lifetimes slide only when it's set (sandbox-config.ts:38-43, 245).
  • Pointers to the new page from the runbook, install, OIDC login, multi-user and the glossary's "subject" entry.

Left out because they couldn't be verified:

  • the lease defaults, which link the lease-mode page instead;
  • whether a test:<n> entry in the allow list enrolls a test user on combined;
  • the hand-export and redaction internals.

There are no internal names, no spec or ADR links, and none of the source repo's citations. The numbered runbook headings are byte-identical.

Overlap with #924 (templates): both PRs touch glossary.md (different entries) and runbook.md (§4 here, §5 and the end there). Either can merge first.

Outside the docs, worth an issue: the OpenAPI NotEnrolled and 403 descriptions still name only SH_ALLOWED_SUBJECTS.

Testing (from a clean clone of the branch)

  • make check-links: 237 files, 0 broken links.
  • scripts/check-docs-publish.sh: 84 files, no matches; no sbx[0-9], cohort or w3id in the changed files.
  • scripts/check-docs-site.sh: 62 pages, no broken links.
  • Prettier 3.10.1 is clean.

Assisted-By: Claude Code

…ate API enrollment

A new reference page, from the user lifecycle material's genuinely new
parts, corrected against the code, and fixes to published pages that
were staler than that material:

- docs/reference/users-and-roles.md (new): subjects (github:, oidc:,
  test:, with examples); who is enrolled and who is an admin (settings
  and the API-backed members store); who can change access, including
  the installer token -- SH_INSTALLER_TOKEN, a static bearer that acts
  as a settings admin on the /v1/subjects routes, read on the sandbox
  profile only; what a damaged members.json does; who can log in on
  each route profile; what happens to a departed user's refresh
  families, sandboxes, sandbox tokens, templates and turn grants; every
  credential's lifetime (linking the security model's "Tokens"); the
  members record kinds and offline verification; the design limits.
- security-model.md and harness/concepts/multi-user.md: the admin role
  no longer comes only from SH_ADMIN_SUBJECTS (API grants, per-request
  roles, oidc: subjects, the installer token). operate/harness/multi-
  user.md §6, install.md (combined counts store enrollment), runbook §4
  (oidc: subjects) and oidc-login.md corrected to match.
- configuration.md gains the settings it lacked: SH_ALLOWED_SUBJECTS,
  SH_INSTALLER_TOKEN and SH_SANDBOX_TOKEN_TTL_SECONDS, _MAX_PER_SUBJECT,
  _LIFETIME_SECONDS, _MAX_LIFETIME_SECONDS (defaults to the lifetime),
  _MODES_ALLOWED, _IDLE_CEILING_S.
- Pointers from the runbook, install, OIDC login, multi-user and the
  glossary's subject entry. Numbered runbook headings unchanged.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 19, 2026
@pdettori
pdettori marked this pull request as ready for review November 19, 2026 18:37

@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 — docs(reference): users, enrollment and roles; fix the pages that predate API enrollment

This is the page the enrollment work never got, and the edits it makes to older pages are the right ones. I checked the claims against the control plane rather than the source material; nothing blocking, no inline comments.

Subjects and the grammar — OIDC_SUB_PATTERN is [A-Za-z0-9][A-Za-z0-9._@+-]{0,127} and every example row follows it (identity.ts:250-260); MEMBER_SUBJECT_RE excludes test:<n>, so the table's "no" for /v1/subjects and owner transfers is right, and SUBJECT_RE still admits it for SH_ALLOWED_SUBJECTS as the configuration row says.

Enrollment and roles — the two equations are membershipNow + onAllowList (members.ts:254-296, sandbox-config.ts:317-328), including "the admin role enrolls". The bootstrap rules are exact: 409 bootstrap_subject for a settings-enrolled or settings-admin subject (member-handlers.ts:93,142,182), 409 admin_granted for a live grant on unenroll (:106), enrolling an already-enrolled subject answers record: null (:73). The installer bearer is checked only on auth: 'admin' routes, timing-safe over digests, minting INSTALLER_SUBJECT with admin (server.ts:113-131), and it is added to bootstrap.admins only where config.installerToken is set — the sandbox profile alone (main.ts:454-467, :745-757). A damaged members.json behaves exactly as the page says, warning at most once a minute (members.ts:250-278). Per-request role replacement is server.ts:251-256; without a store the claims stand.

Profiles and leaving — the login gate before a refresh family is issued (handlers.ts:869-880), the refresh's not_enrolled family revoke (:990-1008), the combined-profile enrolled-only activation (handlers.ts:1164-1171), and the owner-only token/mode routes against the admin-allowed GET/DELETE (sandbox-handlers.ts:140-152, :2945-3060) all match. The sandbox-token outliving removal by one lifetime plus the relay's 30 s leeway is the same statement the runbook makes in §9, and the admin's rm --force reason (no token is minted for another subject's sandbox) is what checkBeforeRm does (sync.ts:453-467).

The members stream — record bodies for enroll, unenroll, grant, revoke and the one control-plane lapse record match member-handlers.ts:60-200 and members.ts:286-312; record-before-rename is MembersStore.change (members.ts:215-230), so "a record for a change the store does not hold, never the reverse" is right; and verify-provenance.py does hold member/role to the members stream only.

Configuration and token lifetimes — every new row checks out: SH_ALLOWED_SUBJECTS required on sandbox/combined (sandbox-config.ts:198-211), SH_INSTALLER_TOKEN ≥32 and secret (main.ts:454-458, CONTROL_PLANE_SECRETS), token TTL 900/≤3600, lifetime 7 days with max defaulting to it and sliding only when the max is set, modes list, idle ceiling 1800/≥30 (sandbox-config.ts:124-267). The credentials table's 900/300/30 d/90 d/300/300 values and the MOCA_GRANT_TTL_S 300 s ↔ MOCA_TURN_MAX_S 1800 s relation are the code's defaults.

Checks — check-links 237 files/0 broken, publish hygiene 84 files clean (§4’s anchors resolve), CI 18/18 including the docs job. Draft PR; the review is against 8c6ee92b.

@webchang webchang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this is accurate. I checked the members routes, the settings-admin rule, the installer token, the store-less fallback and every lifetime and default against the code, and the edits to the pages that predate API enrollment now read right. One fix and two small suggestions:

  1. docs/reference/configuration.md, the SH_SANDBOX_MODES_ALLOWED row: "an empty list fails boot" reads as if unset or empty fails. Unset or empty means per-exec; only a list with no names (such as ,) or an unknown name fails boot (sandbox-config.ts:118-133).
  2. docs/reference/users-and-roles.md:3: "Enrollment and the admin role, on every route profile, are implemented" reads as if enrollment is checked on harness too; the page's own table says it is not. Suggest dropping "on every route profile".
  3. users-and-roles.md:11: "summarised" → "summarized".

… spelling)

- configuration.md, SH_SANDBOX_MODES_ALLOWED: unset or empty means
  per-exec; only a list of no names (such as ",") or an unknown name
  fails boot (sandbox-config.ts:118-133) -- not "an empty list".
- users-and-roles.md: the banner no longer says enrollment holds "on
  every route profile" (the page's own table: harness does not check
  it); "summarised" -> "summarized".

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori

Copy link
Copy Markdown
Member Author

All three points from the second review are fixed in 7a3f257:

  1. SH_SANDBOX_MODES_ALLOWED (configuration.md) now reads "unset or empty means per-exec, while a list of no names (such as ,) or an unknown name fails boot". That matches modesAllowedFromEnv (sandbox-config.ts:118-133).
  2. The banner no longer says "on every route profile": "Enrollment and the admin role are implemented but not yet declared Stable…". That's consistent with the page's own table, where harness doesn't check enrollment.
  3. "summarised" → "summarized".

From a clean clone: 237 files, 0 broken links; site build, no broken links.

@pdettori
pdettori merged commit 4cf876f into rossoctl:main Nov 19, 2026
23 of 24 checks passed
@pdettori
pdettori deleted the docs/users-roles branch November 19, 2026 20:00
@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.

3 participants