Repository navigation
Commit 14801eb
feat(scope): IdP-group server grants, one entitlement predicate, tenant session on core REST and Web UI (Spec 107 PR-C) (#1293)
* docs(specs): Spec 107 — server edition SSO front door hardened for real IdPs
Generic OIDC provider, IdP-group → server allowlist, attributable JSONL
audit line, and a freeze/cut of the latent multiuser/credential-injection
code, split into four PRs (A freeze/cut, B OIDC + front door + telemetry,
C entitlement predicate + tenant session, D audit line).
Judge-panel drafted; cross-model reviewed over nine rounds (codex gpt-5.6-sol),
~130 findings resolved. Un-parks roadmap epic sso.
* test(spec-107): PR-A red tests, server-tag lint job and release notice
Related #1177
* refactor(serveredition): freeze the latent credential-injection chain and normalise removed config keys (Spec 107 PR-A)
Related #1177
* fix(storage): enforce the agent-token cap per owner, not per deployment (Spec 107 PR-A)
Closes #1177
* fix(spec-107): address adversarial review of PR-A
* fix(spec-107): codex round 1 for PR-A
* fix(spec-107): codex round 2 for PR-A
* fix(spec-107): codex round 3 for PR-A
* fix(spec-107): codex round 4 for PR-A
* docs(spec-107): PR-A verification and task ticks
* docs(roadmap): link PR-A
* test(oauthserver): fake OIDC identity provider and server-edition dev rig (Spec 107 PR-B)
* test(serveredition): red tests for the generic OIDC provider, subject binding and refusals (Spec 107 PR-B)
* feat(serveredition): generic OIDC provider with JWKS-verified ID tokens, groups capture and subject binding (Spec 107 PR-B)
Related #1169
* test(serveredition): red tests for trusted proxies, public URL, cookie security and forced MCP auth (Spec 107 PR-B)
* feat(serveredition): front door behind an ingress — public URL, trusted proxies, cookie security policy, forced MCP auth, provider probe (Spec 107 PR-B)
* feat(config,telemetry): hot-reload clauses, docs and OAS for the PR-B keys; telemetry v13 server-edition fields (Spec 107 PR-B)
* fix(spec-107): gate fixes for PR-B
* docs(spec-107): PR-B automated-check evidence
* fix(spec-107): cross-review round 1 for PR-B
* fix(spec-107): cross-review round 2 for PR-B
* fix(spec-107): cross-review round 3 for PR-B
* fix(spec-107): cross-review round 3 for PR-B
* fix(spec-107): cross-review round 4 for PR-B
* fix(spec-107): cross-review round 5 for PR-B
* fix(spec-107): cross-review round 6 for PR-B
* docs(spec-107): PR-B real-instance verification, gate re-run, task ticks
T062/T063: real-instance verification of the OIDC front door (happy-path
login, groups, /auth/me, agent-token mint + /mcp initialize/tools-list,
ErrorMode tamper matrix, cookie Secure matrix behind a simulated trusted vs
untrusted proxy) and the telemetry v13 payload (server vs personal). T064:
full gate set re-run on HEAD after cross-review round 6 touched the config
load path, oauth_handler.go and telemetry.go — all green. T066: tick
completed PR-B tasks (T032-T066); ROADMAP.md regenerated.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(roadmap): link PR-B
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci): pull forward the Windows heap-corruption + Pass-2 race fix (#1288)
This branch diverged from main before #1288 landed, so PR-B's CI hit the
exact regression it fixed: handleAddFromRegistry's success path dereferenced
a nil cfg, chi's recoverer turned the panic into a bare 500, and the
recovered hardware fault corrupted the Go heap on windows/amd64 under Go
1.26 (golang/go#81238) — the internal/httpapi test binary crashed with
"found pointer to free object" and took the whole Windows unit-test job (and
the binaries job's httpapi/scanner test bundle) down with it. Cherry-picked
the same fix main already carries: the nil-config guard with a JSON 500 (and
its pinning test), plus the unrelated Pass-2 temp-dir teardown race fix in
the scanner test this same upstream commit bundled.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(spec-107): record the CI red/fix cycle for PR-B
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(spec-107): record PR-B CI green
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(spec-107): cross-review round 7 for PR-B
* fix(spec-107): cross-review round 8 for PR-B
* test(serveredition): two-fixture non-disclosure harness and single-predicate guard (Spec 107 PR-C)
* test(scope): red tests for group grants, owner resolution, scoped index search and minting doors (Spec 107 PR-C)
* feat(scope): one entitlement predicate with IdP-group grants, owner resolution on every authentication, scoped index search (Spec 107 PR-C)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* test(httpapi,frontend): red tests for the tenant session principal, route allowlist and Web UI gating (Spec 107 PR-C)
* feat(httpapi,web): tenant session principal on core REST, profiles/SSE/activity projections, Web UI on the SSO session alone (Spec 107 PR-C)
T083: SessionPrincipalResolver type in internal/httpapi/session_principal.go; rewrote
apiKeyAuthMiddleware with FR-001 precedence (X-API-Key > Authorization > ?apikey > session cookie).
Auth context now excludes session principals from CanRevealSecrets.
T084: Session principal resolver built in setup.go via userHandlers.ResolveAgentTokenOwner,
installed via Dependencies and wired in serveredition_wire.go.
T085: GET /profiles omits profiles whose entitlements don't intersect session scope;
GET /profiles/active returns empty when active profile is hidden. SSE and activity paths
re-resolve session principals before every frame for live-narrowing.
T086: Activity filtering and masking for tenant sessions; GET /user/activity added;
admin_user principals answer unconditionally with empty list (SC-006).
T088–T089: Frontend principal-kind gating for tenant sessions (onboarded to /login,
hidden config/routing/servers/stats/security/activity surfaces). AdminUsers adds Groups
column; AdminServers shows server-scoped group/grant chips. Playwright e2e test added
(quickstart.md spec).
Both editions build clean; all unit-tests.yml -tags server race suites pass.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* docs(spec-107): access block reference, agent-token invariant, hot-reload and OAS wiring for PR-C
* fix(spec-107): gate fixes for PR-C
Full plan.md gate set run against PR-C HEAD (1e379ff): all gates
pass, no PR-C code required fixing. golangci-lint's pinned v2 binary
refuses the go1.26 module (pre-existing tooling gap); the @latest
fallback found 16 issues, all pre-existing and outside the PR-C diff.
The isolated test-api-e2e.sh run's two failures (launcher-lifecycle
reconnect/log capture) are spec-046 fixture flakes unrelated to any
PR-C file, reproduced identically on two runs. Records the full
pass/fail table under '## PR-C / ### Automated checks' in
verification.md.
* fix(spec-107): cross-review round 1 for PR-C
Four genuine defects found and fixed across three opencode
gpt-5.6-sol/terra review chunks (a fourth chunk was clean plus two
low-value findings rejected as pinned-by-design or non-security):
- tenantSessionAllowlist matched on the DECODED r.URL.Path, but chi
routes on RawPath — a server name containing a literal "/" (nothing
forbids one; only ":" is refused) reaches the real handler via its
percent-encoded id while the allowlist Cuts the decoded path on the
wrong boundary, bypassing the named must-refuse for
/servers/{id}/tool-calls. Fixed by matching on RawPath when set.
- visibleSharedServers/visibleSharedServer independently re-read the
live admin-config snapshot after the entitlement predicate had
already read its own, opening a hot-reload race where a server
could be entitled against one snapshot and disclosed from another.
Fixed with tenantEntitledSnapshot, which fetches the snapshot once
and threads it through both the predicate and the disclosure lookup.
- GET /user/activity read AllowedServers off the AuthContext, but the
ServerEditionAuthMiddleware this door is actually mounted behind
never populates that field (only the separate SessionPrincipalResolver
path does) — so every tenant on this door saw every user's activity
for every server, entitled or not. Fixed by resolving the entitlement
set live through the one predicate instead.
- Dashboard.vue's loadActivitySummary was the one dashboard loader
missing the tenant guard its four siblings already carry, drawing a
spurious 403 against the now-allowlist-refused /activity/summary on
every tenant page load and 30s refresh.
Also corrected RELEASE_NOTICE.md's inverted claim about the access
block's default (absent = Shared-only, NOT deny-all; only a present-
but-empty block is deny-all) and widened the Playwright refused-route
smoke list with several named must-refuse examples.
Two findings verified and rejected: the nil-vs-empty access-block
collapse in ServerEditionAccessProjection is deliberate, pinned by an
existing config_hotreload_serveredition_test.go case; rejecting an
empty group_servers key is defensive config validation, not a spec
violation.
* docs(spec-107): record PR-C cross-review round 1
Appends the round 1 entry (4 genuine findings fixed, 2 rejected with
reasons, full verification command list) under PR-C.
* fix(spec-107): cross-review round 2 for PR-C
Cross-model review (opencode gpt-5.6-sol/terra) round 2 of PR-C:
- entitledServerNamesFor read the admin-config servers once (round 1's
fix) but the access block through a separate, independent live call,
so a hot reload landing between the two reads could splice a servers
snapshot from one configuration version to an access snapshot from
another. A new EntitlementSnapshotProvider derives both values from
one liveConfig() read, wired in setup.go.
- The /events heartbeat branch never re-resolved the session principal,
unlike its status/runtime-event siblings, so a disabled tenant's
otherwise-idle stream never closed (FR-005).
- The tenant profile projection only omitted a profile when scoping
narrowed a non-empty effective set to empty, missing the case where
the effective set was already empty.
- Three tenant-dashboard call sites (Usage.vue's activity/usage poll,
refreshSecurityScannerStatus, the ModeSwitcher control) and one
Activity.vue fallback path issued or exposed admin-only core requests
to a tenant session, contradicting FR-041; a doc paragraph misattributed
an administrator-only capability to tenants.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(spec-107): record PR-C cross-review round 2
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(spec-107): PR-C real-instance verification, gate re-run, task ticks
T079/T090: real-instance verification against the dev-server-edition
rig (quickstart §5-§7) - entitlement-filtered REST, non-disclosing
by-name refusals matching a nonexistent server, "*" token
materialisation to the entitled set, hot reload narrowing a live
session/token with no restart or rotation, JWT self-renewal refused,
live administrator parity. Web UI/Playwright run against the rig with
a properly embedded frontend (make build-server, since the rig
script's bare go build does not embed it): 4/5 pass; the 5th hit a
pre-existing router deep-link/reload bug (title updates, body does
not) unrelated to the PR-C diff, flagged as a follow-up rather than
fixed inline.
T093: full gate set re-run against HEAD (aac5053, after both
cross-review rounds), since review landed code changes after the
prior gate run. All 19 non-e2e gates green; isolated
test-api-e2e.sh run twice (63/65 both times, same pre-existing
launcher-lifecycle pair, unrelated to PR-C).
Ticks T067-T095 in tasks.md; ROADMAP.md regenerated.
* docs(roadmap): link PR-C
* fix(spec-107): cross-review round 3 for PR-C
* docs(spec-107): record PR-C cross-review round 3
* fix(spec-107): wait for PhaseReady before seeding the group-scope fixture (PR-C CI)
TestMCPGroupScope_TwoFixtureParity_GroupScopedToken failed in CI (not
locally) because newGroupScopeFixture wrote directly to storage/upstream
manager right after NewServer(), racing StartBackgroundInitialization's
async LoadConfiguredServers — which treats cfg.Servers as the source of
truth and unconditionally re-saves every entry (including the disabled
shared-server placeholders this fixture registers) before flipping the
runtime to PhaseReady. When that reconciliation write lands after the
fixture's own Enabled:true write, the server reverts to Enabled:false in
storage and isExactToolCallable drops its indexed tool from
retrieve_tools — exactly the observed empty-vs-populated mismatch.
Same race already fixed once in this codebase (see
newLogsTestServer/server_logs_missing_file_test.go); this applies the
same require.Eventually(PhaseReady) guard here.
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 673e83c commit 14801eb
99 files changed
Lines changed: 9799 additions & 576 deletions
File tree
- .github
- docs
- configuration
- development
- features
- e2e/playwright
- frontend
- src
- components
- composables
- services
- stores
- views
- teams
- tests/unit
- internal
- auth
- config
- httpapi
- index
- preflight
- runtime
- serveredition
- api
- auth
- multiuser
- testdata
- server
- storage
- specs/107-server-edition-sso-hardening
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
430 | | - | |
431 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
| 437 | + | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
899 | | - | |
| 899 | + | |
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
| |||
1038 | 1038 | | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | | - | |
| 1041 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
317 | 326 | | |
318 | 327 | | |
319 | 328 | | |
| |||
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
375 | | - | |
| 384 | + | |
376 | 385 | | |
377 | 386 | | |
378 | 387 | | |
| |||
0 commit comments