Repository navigation
feat(profiles): scope attribution and profile/client/token filters (Spec 108-e) - #1436
Merged
Merged
Conversation
…s and sessions (Spec 108-e) Adds first-class attribution fields to activity records (profile, profile_source, client_id, client_name, token_name, block_reason) and sessions, the storage filters with the unattributed sentinel and legacy fallbacks, the emit-time attribution seam, and profile_change fields.
…age and sessions (Spec 108-e) Fills the scope filter list (profile, client, token), maps agent onto the token filter, adds client_name on activity and export, evaluates filters against the owner-redacted view for scoped callers, appends CSV columns, redacts foreign attribution on records, detail, export and SSE, and serves usage under a scope filter from a window-bounded scan.
… (Spec 108-e) Adds the access chain evaluator (internal/server/access_chain.go) whose callable verdict is pinned against real dispatch, GET /tools?client= and ?profile= with per-row access and profile_tier, counts for non-admin views, and GET /servers?profile= with visible tool counts.
…le filter on upstream list (Spec 108-e) Adds --profile, --client, --token and --client-name to activity list/watch/summary/export with --agent kept as a deprecated alias of --token, CLIENT and PROFILE columns, attribution lines on activity show, and --client/--profile on tools list and --profile on upstream list.
…e filters Updates the Spec 108 tasks, spec, data model, contracts, plan, quickstart and research (D31), the REST and CLI docs, the generated OpenAPI and the roadmap. Marks the 108-e tasks done.
…endpoints that honour them (Spec 108-e) features.scope_filters lists parameter names, but the composable only matched the feature name, so the parameters never un-hid against a real backend. The Clients and Tokens pages send nothing to /clients or /tokens until Spec 108-f.
…ecords from the request context (Spec 108-e)
Deploying mcpproxy-docs with
|
| Latest commit: |
33c8208
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d1d53ad0.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-e-scope-attribution-filt.mcpproxy-docs.pages.dev |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36737330443 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…ugs (Spec 108-e) The Activity Sessions view no longer lets the unscoped on-mount /sessions response overwrite the scoped rows, and a scoped caller no longer reads another token's legacy metadata.profile (REST) or flat profile (SSE).
5 tasks
12 tasks
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.
What this changes
Spec 108-e (
specs/108-profiles-v3, tasks T056-T066 plus the new T061a, T061b and T065a). Every activity record and session now says which profile, client and token it ran under, and the grid endpoints filter on those values. It closes FR-029 to FR-033 and the "scope is unverifiable" gap behind audit problems P5 and P6 (acceptance checks 2 and 6).REST and core
profile,profile_source,client_id,client_name,token_nameand, for a blocked call,block_reason. The values are those in effect when the call ran and are never rewritten, so reassigning a client later leaves history alone.metadata.profileandmetadata.block_reasonare still written for one release. Aprofile_changerecord now carries the new profile, client id and token name as first-class fields.client_id,token_name,profileandprofile_source; a changed resolution is written through once, not on every call.profile,clientandtokenfilter/activity,/activity/export,/activity/summary,/activity/usageand/sessions;agentis now an alias oftokenon all five (naming two different tokens is a 400).client_namefilters/activityand/activity/exportonly and is a 400 on the other three.-selects records with no value. Records written before this change still match through their legacy keys.GET /tools?client=and?profile=return every tool withprofile_tierandaccess {visible, callable, reason}.callableis computed by the new access chain ininternal/server/access_chain.go, which calls the same predicates a real call does; a test dispatches every enforcement-matrix row and requires the verdict to match the outcome.client=is administrator only. A non-administratorprofile=view gets only the visible rows pluscounts {visible, hidden}, and an unreachable profile answers exactly like an unknown one.GET /servers?profile=limits rows to the profile's servers with visible tool counts.attributionobject is delivered only on the subscriber's own events. The internal token prefix never reaches the wire./activity/usageunder a scope filter is computed from a window-bounded scan of the matching records (the persisted aggregate is unchanged and the unfiltered path stays scan-free); the filters are part of its cache key.GET /statusnow advertisesfeatures.scope_filters: ["profile","client","token"], read from the same list the 109-k gate uses./tokensand/clientsstill answer400 unsupported_scope_filteruntil 108-f.CLI
activity list|watch|summary|exportgain--profile,--client,--tokenand--client-name;--agentstays as a hidden deprecated alias of--token.summaryrejects--client-namewith the REST text.activity listshowsCLIENTandPROFILEcolumns,activity showprints client, profile, token and block reason, and CSV export appends the six new columns afterparent_id.tools list --client/--profileaddsACCESSandREASONcolumns;upstream list --profilerestricts to the profile's servers (both moved here from 108-g so one PR owns each REST parameter end to end).Web UI
scope_filters, while the backend lists parameter names, so the hiddenprofile,clientandtokenparameters could never un-hide against a real backend. It now matches the listed names, andrestPageslimits what is sent to the endpoints that honour them, so the Clients and Tokens pages send nothing to/clientsor/tokensand no page starts receiving a new 400 between this PR and 108-f.macOS app
Spec docs and generated files
Plan decisions applied to tasks, spec, data model, contracts, plan, quickstart and research (D31);
oas/swagger.yamlandoas/docs.goregenerated; REST and CLI docs updated. Declared golden changes: none (no MCP tool schema changes; the tool-surface goldens andinternal/indexare untouched).Tests added
Storage filters and session filters; attribution stamping for every profile source, blocked calls, sub-calls and no-history-rewrite; session identity persistence; the access chain against real dispatch; REST view-as through the real router with stored tokens; scoped-caller disclosure and SSE tests; usage scan and cache key; the gate lists; CLI flag, alias, watch-filter and view-as tests; a frontend availability test.
Follow-ups
EmitActivityToolCallRejected) have no request context and stay unattributed.GET /sessionsparsesoffsetbut never applies it (pre-existing).clientto/activity(the Web wiring is 108-j); land 108-f next.