Repository navigation
feat(api): profiles and clients REST surface, config funnel and access explainer (Spec 108-f) - #1439
Merged
Merged
Conversation
…nk headers (Spec 108-f)
…c token re-pin and typed profile validation (Spec 108-f)
…lassify and anonymous_profile (Spec 108-f)
…ications and profiles.changed (Spec 108-f)
…ain routes (Spec 108-f)
…d token profile filters (Spec 108-f)
… the profiles and clients surface (Spec 108-f)
…-funnel write (Spec 108-f)
…rose in the door inventory (Spec 108-f)
…p a redundant cfgPath write (Spec 108-f)
Deploying mcpproxy-docs with
|
| Latest commit: |
c28dab5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://803902c8.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-f-profiles-clients-rest.mcpproxy-docs.pages.dev |
F3.1 (medium): the admin-key upgrade no longer skips a client whose config
read was denied or malformed, or whose status call failed. Such a client may
still hold the admin key, so it is now an unresolved preview row with an error,
a failed[] entry on apply, and withholds next_step (rotate_admin_api_key) until
every client is resolved. Test fails without the fix.
F5.1 (medium): the profile-change notifier remembers every published snapshot,
including ones with an empty delta, and delivers a batch once the runtime's
current snapshot is the batch's or any later one. An unrelated publication
racing a profile edit no longer strands the batch until the 5s drop. Test
fails without the fix.
F5.2 (low): a rename holds notification delivery (new
ProfileSessionHook.HoldProfileNotifications) from before the publish until
ProfileRenamed rewrote the stored selections, so the client's re-list follows
the rename. Residual: an unrelated request in the publish-to-rewrite window
can still resolve the old selection; not closed here.
F4.1 (low): PUT /profiles/{name} keeps the nameless-body convenience; an empty
name is handled like an omitted one (already true, now tested). Documented as
accepted-by-spec in docs/api/rest-api.md and contracts/rest-api.md; swagger
regenerated.
sol:6b.1 (low): the conservative-guard delete test could not fail (auth was
on). Replaced by a test with require_mcp_auth off and a spy guard that
refuses the post-reassign binding; it fails if the funnel stops consulting
the guard. Note: the real conservative guard never refuses a delete-with-
reassign of an already-bound client (not newly bypassable), so the refusal is
driven by the spy.
Round 2 confirmed F3.1 and F5.2 fixed (both tests fail if reverted). The residual lows it named are closed here, test-first. F1.1 (low): the admin-key upgrade guard (FR-008a) judged every preview row, including unresolved clients and failed previews that the apply never writes. With a named profile that could refuse a request minting nothing, and named clients that would receive no binding. The guard now considers only rows without an error. Test fails without the fix. F1.2 (low): awaitPublished counted the time a rename held delivery against its publish deadline, so a rename outlasting waitFor (5s) dropped the batch. A held notifier now resets the deadline. Test fails without the fix. F1.3 (low): the held() check and deliver() were separate, so a rename could begin between them. The check and a delivering flag are now atomic under one mutex, and hold() waits for an in-flight delivery. Test fails without the fix.
…o 108-f-profiles-clients-rest-fix
…DATA (Windows TempDir cleanup)
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36769738698 --repo smart-mcp-proxy/mcpproxy-go
|
3 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
…ewing chip (Spec 108-i) (#1444) ## Summary Spec 108 PR 108-i: the Web UI for profiles, client bindings, token profiles, the access explainer and the header Viewing chip. It is frontend-only (plus the e2e sweep, scripts/docs and spec docs). REST, CLI, MCP and the macOS app are unchanged here: the REST surface is 108-f (#1439), the CLI and MCP tool are 108-g and 108-h, the macOS app is 108-k. Spec: `specs/108-profiles-v3` (FR-005, FR-008a, FR-021 to FR-026, FR-040 to FR-046; tasks T090 to T103 including T042w and T098a; decisions recorded as D35 in research.md). Audit group `108-i`; it removes the header "Profile:" switcher that read as agent scoping (P1) and gives the admin-key remediation a Web path (P4). ## What changes for the user **Profiles page (`/profiles`)** - Card grid: title and slug, max tier, tool counts by tier, unannotated hidden, who uses the profile (administrators only), calls and blocked in 24 h, and Tools, Activity, Clients and Tokens links that carry `?profile=` through the link map. - An "All servers" card comes first and shows the anonymous status with a link to Settings. - "Add profile" (also `+ Add` and the palette via `?create=1`) creates a profile in one dialog: name, title, servers and a starting point (Read-only, Read + write, Everything, Custom). - Card actions: Edit, Assign to client, Create token with this profile, Delete. - A server-edition tenant sees the page read-only without `used_by`. **Profile editor (`/profiles/:name`)** - Form with title and description counters, servers (unknown ones flagged), max tier, unannotated handling, code execution and management tools (On, Off, Inherit), "Agent may switch to", and "Assigned to". - Per-tool table from `effective-tools`: tier, the access reason in words, Allow and Deny toggles, Classify for unannotated tools, and the stale-classification marker "classification ignored — tool is now annotated". - Edits change a local draft with a sticky Save and Discard footer; the PUT body follows the omission semantics. A 400 marks the field, a 409 guard refusal keeps the draft and shows the two fix buttons. - "Try it" posts the current draft to `/profiles/try`. Rename and Delete list what moves first (clients with mode, tokens, `switchable_to` references, anonymous callers); delete requires a target unless "leave them without a profile" is chosen, which is not offered for the anonymous profile. - `?focus=server:tool` rings the row, sets `aria-current`, focuses its Allow toggle and announces it; if the server is not in the profile it offers to add it. - A `profiles.changed` event never overwrites an unsaved draft; it shows "This profile changed elsewhere" with Reload. **Clients page** - One "Profile" column is appended after Config path; Spec 109's columns are unchanged. The chip shows `Work · Read-only · locked by credential` (or `switchable`), a Locked switch, the credential badge and blocked calls. Selecting a profile sends the binding without a mode. - Rows with no client credential disable the chip and switch and offer "Upgrade to client credential" or "Reconnect", which opens the connect dialog on that client. - Warnings banner (`role="status"`, severity in text) for every warning code, each with its action. - Toolbar: "Move clients…" (bulk, with the skipped list), "Upgrade admin-key clients…" (preview, guard, apply with the combined precondition token, then the "Rotate the admin API key" panel; the dialog never rotates the key) and "Add other client…" (custom client; the credential is shown once and cleared on close). - Expanded row: credential details, staged Rotate (supported clients preview first; custom clients show the new credential once, then a pending badge and "Finalize now"), Forget, and "Explain access…". - The profile and client filters of the URL contract are sent to `GET /clients` and `GET /tokens`. **Connect dialog (T042w)**: profile picker and Locked switch, the masked `mcp_cli_••••` credential and the notice that the admin key is never written, the management-tools notice, a keyless option only while authentication is off, guard and token-name-conflict errors, and the same profile for a bulk connect. **Token dialog**: Profile first, with "None — legacy scope" enabling the legacy fields; the list shows Kind, Profile, Mode and a Legacy scope badge; client-credential rows are read-only with a pointer to Clients. **Settings → Security**: "Anonymous callers" profile selector with the binding-guard explanation. A guard fix button navigates here with the value preselected and never saves. **Header**: the Viewing chip replaces the profile switcher. It reads and writes the URL filter contract, never calls a binding route, collapses to an icon below 1100 px, and is hidden for tenants and when there is nothing to filter by. ## Deviations from the plan (recorded in research.md D35) - The anonymous setting saves through a new `setAnonymousProfile` API method (PATCH `/config`) instead of `patchConfig`, because `patchConfig` drops the 409 body. - The static "Other client?" snippet stays (existing tests pin it) and points at "Add other client…". - The connect dialog sends profile, mode and keyless only after a binding control was touched, so a reconnect keeps the credential's binding. - `explain_blocked.json` already has the F24 shape, so the conditional Go fixture change did not happen and this PR changes no Go file. - `Settings.vue` already highlights `?focus=<key>` rows, so `SettingsSection` needed no `focus` prop. - Tokens under "Assigned to" link to the Tokens tab (no route re-pins a token). - The `/tokens` redirect route gets the name `tokens` that the link map already assumed. ## Tests New vitest specs: `profiles-page`, `profile-policy-editor`, `client-binding-controls`, `token-dialog-profile`, `access-explainer`, `viewing-filter`, `contract-fixtures`, `connect-profile-fields`, `settings-anonymous-profile`, `api-error-body`, `profiles-sse-refresh`. New Playwright spec `e2e/web-ui-sweep/profiles-clients.spec.ts` (seeded over REST by `profiles-seed.ts`), listed in `scripts/run-web-smoke.sh`; `visual-a11y-sweep.spec.ts` gains the Profiles, editor and Clients routes in both themes; `navigation-consistency.spec.ts` now expects the Profiles sidebar entry and the Profile item in the Add menu. Existing specs updated: `header-layout`, `top-header-tenant-gating` (the profile population gate moved to the chip), `auth-shell-recovery`, `connect-preview` (credential notice replaces the API-key notice). Deleted with the component: `profile-switcher` and `profile-switcher-hidden`. ## Follow-ups The Tools and Activity entry points of the explainer and the Tools view-as and Activity attribution UI are 108-j.
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
…nd explainer (Spec 108-k) (#1442) ## Summary Spec 108-k (`specs/108-profiles-v3`, tasks T110a to T120 and T042m): the macOS app and tray learn profiles, per-client bindings, token profiles, scoped views and the access explainer. It consumes the REST surface merged in 108-f (#1439); it changes no Go, frontend, `oas` or contract file. ## What a user sees - **Profiles page.** A new sidebar item in Connect (Clients, Profiles, Servers, Tools) and a "Profile" entry in the toolbar "+" menu. An "All servers" card first, then one card per profile with its tier, tool counts, what uses it, calls and blocked calls in 24 h, and Tools, Activity, Clients and Tokens links that open filtered by that profile. The editor covers every profile field, a per-tool table with Allow, Deny and Classify (unannotated tools only), the stale-classification marker, "Try it" on the unsaved draft, "Assigned to", and rename and delete sheets that list what they move and require a target. - **Clients.** A binding label and credential badge on each row; in the detail a profile Picker, a Locked toggle, credential state and expiry, blocked calls, Rotate, Finalize rotation, Forget and Explain access. A client without an active client credential gets no working picker, only "Upgrade to client credential…" or "Reconnect…". A warnings banner, "Move Clients…", "Upgrade Admin-Key Clients…" and "Other Client…" (the credential is shown once, never stored). A binding-guard refusal shows both fixes; the fix buttons only open Settings. - **Connect sheet.** Profile Picker and Locked toggle, the masked `mcp_cli_••••` credential line in place of the API-key notice, the notice that a client credential cannot reach management tools unless the profile allows them, keyless under Advanced only while authentication is off, and the CLI-format result line. Nothing about the binding is sent until the controls are touched, so a reconnect keeps its binding. - **Tray.** The "Profile:" switcher is gone. A "Clients" submenu lists each credentialed or connected client as `name — profile 🔒` with the profile list, a checkmark and Lock or Unlock; a client without a credential offers "Upgrade to client credential…". Glance client rows open that client's activity once the core attributes calls. - **Agent Tokens.** Create Token asks for a Profile and an Expiry; the legacy servers and permissions sit under "Legacy scope (advanced)". The list shows kind, profile chip and mode, read-only legacy scope with a "Migrate to a profile" hint, no Revoke on client credentials, and Profile and token-name filters. - **Settings.** Security gains "Anonymous callers" (PATCH `anonymous_profile`, guard refusal shown, fix buttons preselect without saving) and scroll-to-and-highlight for `require_mcp_auth`. - **Scoped views.** Activity gets a Caller column and Profile, Client and Token pickers; Tools gets "View as" with greyed rows, reasons and a "Why?" button; Home filters usage and sessions and shows Profile and Source columns; Servers filters by profile. - **Live refresh.** SSE `profiles.changed` and `client.binding_changed` refresh the lists (debounced). The command-number shortcuts shift: Profiles is third, so Servers is now ⌘4, Tools ⌘5, Review Queue ⌘6, Secrets ⌘7, Activity ⌘8 (documented in `docs/development/macos-tray.md`). ## Audit findings addressed The macOS column of the parity matrix for profiles, client bindings, credential state, token profile and expiry, anonymous callers, view-as, attribution columns, bulk move, admin-key upgrade, rotate, forget, custom client, explainer and the tray Clients submenu (FR-005 editor marker, FR-047 to FR-050, T042m). ## Spec `specs/108-profiles-v3` (tasks.md Phase 12 ticked, FR-047 to FR-049 wording, quickstart row, research D36). ## Tests New suites: `ProfilesV3ContractTests`, `ClientsTrayMenuTests`, `ProfileEditorModelTests`, `ClientBindingModelTests`, `AccessExplainerModelTests`, `TokensCreateModelTests`, `AnonymousProfileSectionTests`, `APIClientProfilesTests`. Extended in place: `NavigationStructureTests`, `ScopeFilterTests`, `ConnectClientModelTests`, `ProfileModelsTests`, `TrayAuditMenuTests` (inverted), `TrayPresentationTests`. The full suite passes (1575 tests). The new tests do not compile on the merge base, which lacks the models they use. ## Deviations from the plan - Activity shows one "Caller" column (client, profile with source, token, block reason) instead of three columns, to keep the list usable next to the detail panel at 800 pt; the detail panel carries each field separately. - Delete requires a "Move them to" target whenever anything is listed (identical to the Web plan). - Accessibility id is `toolbar-add-Profile`, capitalised like the other 109-i ids. - The token list model now decodes the real response shape (`name`, `allowed_servers`); the old model required an `id` and read `servers`, and the old Create Token sheet sent `servers`, which the core ignores. - There is no separate F24 access-explanation fixture on main; `explain_blocked.json` already carries `subject.kind` and is decoded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements PR 108-f of Spec 108 (Profiles v3): the REST surface and runtime services for profiles and clients, on top of the merged 108-a through 108-e policy, enforcement and clients-hub work.
What changes
Runtime.MutateConfig): one path for every profile or client config write. It reads the desired config, applies the mutation, runs the FR-008a binding guard over the whole candidate state, re-pins tokens in a single bbolt transaction (restored on failure), applies the config, recordsprofile_changeactivity and reconciles the per-profile search indexes.GET/PUT /profiles/activestay but now sendDeprecationandLinkheaders.GET/POST /profiles,GET/PUT/DELETE /profiles/{name},POST /profiles/{name}/rename,POST /profiles/try,GET /profiles/{name}/effective-tools, with typed validation errors (fieldplus the FR-007 text),409 profile_in_usewithused_by,profile_is_anonymous_profileeven underforce, andreassign_towith the guard delta. Scoped callers see only reachable profiles, and unreachable profiles answer with the same 404 as unknown ones.GET /access/explainreturns the nine-step chain for a client, token, anonymous caller or explicit profile. Built-in tools are rejected with 400. Scoped callers get 403.profiles.changedon the admin SSE stream and sendtools/list_changedto affected MCP sessions once the new (index, snapshot) pair is published. Scoped SSE streams never receive either event.mcp_cli_credentials, rotate and finalize, forget with optional disconnect, and the admin-key upgrade preview and apply with a combined precondition token. The binding guard applies to every write.profileon create sets the pin with defaults,client-names are reserved, andGET /tokensandGET /clientsacceptprofileandclientfilters.oas/swagger.yaml, frontend contract types,docs/api/rest-api.md, and the Spec 108 documents (plan edits applied, T067 to T077 ticked).Verification
Unit and integration tests were written first for each task.
go test -racepasses for the touched packages in both editions using the CI skip regex,golangci-lintreports nothing in changed files, and the frontend build and vitest, plusswift testfor the tray decode check, pass. The quickstart recipe for 108-f was replayed against a scratch instance with its own data directory, covering the client and profile flows, rename with a live session, hand edit, guard refusals, scoped callers, custom client rotation and forget.