Skip to content

Show restricted members only their own MCP servers - #1779

Closed
helpcodeai wants to merge 3 commits into
mainfrom
fix/restricted-members-servers-v2
Closed

helpcodeai wants to merge 3 commits into
mainfrom
fix/restricted-members-servers-v2

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

An evaluator found that in a workspace with restricted member visibility a VIEWER could see other members' MCP servers: their names (including the owner, as in "Default (Alice)"), the connectors on each, the /mcp/... endpoint, last use and calls in the last 30 days. The cause was the server rule: a restricted member saw every server holding a connector they were allowed to see.

With this PR, a restricted member who is not an admin sees only the MCP servers they own, on every route that lists, reads, counts or reports servers or their usage. Any other server's id gets the same 404 as an unknown id, on reads and on writes. On their own servers they still see only the connectors their roles allow. Admins and open workspaces are unchanged.

The PR also:

  • closes the File Search REST routes to restricted members unless they own the connector,
  • adds a spec that fails when a route has no member-visibility decision,
  • adds an end-to-end test of the restricted VIEWER scenario against PostgreSQL,
  • fixes the other leaks the route inventory turned up (listed below).

Cloud and self-hosted: the behaviour is the same in every edition. It changes only for members who are not admins, and only in workspaces an admin has switched to Restricted. Open stays the default.

Changes

MCP servers (priority 1)

  • serverWhere now returns { userId } for a restricted scope, and canSeeServer is its in-memory twin. This covers findAllVisibleByOrg, findVisibleById, isVisibleTo, the grant service (picker, keepVisible), and the mcpServers field on connector detail.
  • PUT/DELETE /api/mcp-servers/:id and PUT /:id/connectors give the unknown-id 404 for a server the member does not own. Before, they answered 403, which confirmed the server existed. Assigning a connector the member cannot see answers 404, like an unknown connector.
  • Server picker, consent page and grants:
    • only the member's own servers are offered, plus the whole-workspace choice;
    • the consent page no longer names a requested server the member may not see;
    • when a restricted member's own server is the only one on offer, the consent page grants the whole workspace, where roles decide the tools. Without this, their single own server (often empty) would be granted automatically.
  • GET /api/mcp-connections and GET /api/mcp-keys leave out, or set to null, any server the member does not own. POST /api/mcp-keys with such a server answers 404.
  • Shared MCP endpoint: the server links handed to the model by anythingmcp_get_configuration_url used to list every server of the workspace, with its /mcp/<id> URL. They now list only the member's own servers (McpConnectionGrantService.serverNamesFor).
  • Audit:
    • In the invocations list, a member's own call made through someone else's server has mcpServer/mcpServerId set to null. mcpServerId= filtering on such a server matches nothing.
    • Tool performance uses the same rule in SQL: masked server columns, GROUP BY position, and the same expression in the latest-error lookup.
    • Breakdowns count those calls in one byServer row with id: null.

File Search (priority 2): every /api/file-search/connectors/:id/** route, writes included, answers 404 unless the member owns the connector. This also applies to a connector shared through roles: the overview, tree, problems, runs, scans and access rules show the address, every folder and file name and the role rules. That is more than the tools give, and the tools apply the folder rules. capabilities and policy are unchanged (plan, limits, aggregate usage). No ee/ change was needed. The fix is in src/file-search/ only.

Route decisions and tests (priority 3)

  • src/settings/member-visibility.routes.ts gives an explicit decision for each of the 385 handlers: scoped, admin-when-restricted, admin-only, owner-or-admin, own-data, role-governed, workspace-config, no-member-session or mcp-roles.
  • member-visibility.routes.spec.ts loads every controller file, reads the Nest route metadata and fails when:
    • a route has no decision, or a decision has no route;
    • an unannotated admin-only route lacks @Roles('ADMIN');
    • a scoped controller does not inject MemberVisibilityService (three listed routes delegate to McpConnectionGrantService instead).
  • MemberVisibilityInterceptor (registered app-wide by MemberVisibilityModule) enforces admin-when-restricted with a 403, without editing those controllers, some of which are under ee/. For any other route it is only a map lookup.
  • member-visibility.restricted-viewer.integration.spec.ts (PostgreSQL, gated on AUDIT_TEST_DATABASE_URL like the other integration specs; CI provides it):
    • Fixture: 6 connectors owned by an admin, a role whitelisting the tools of one connector, a VIEWER with that role, and servers owned by the admin, another member and the viewer.
    • The viewer gets exactly 1 connector, in the reduced view, and only their own server, with that one connector.
    • The other servers' ids give a 404 identical to an unknown id on GET, activity, PUT, PUT connectors and DELETE.
    • The picker, connections, keys and audit name only the viewer's own server.
    • A final scan of everything the viewer read finds no address, no other member's server name, no endpoint and no hidden connector name.
    • Run against the old serverWhere, 7 of its 11 tests fail.

Route inventory: leaks fixed beyond servers and File Search (priority 4)

  • Knowledge graph GET /api/knowledge-graph, /skills and /skills/:id/versions were open to EDITORs. They return the graph of every connector and skills learned from every member's requests. Now admin-when-restricted.
  • Learning projects (ee/, enforced from outside ee/): list, get, lessons, setLesson, preview and publish were open to EDITORs. They return lessons drawn from another member's requests. Now admin-when-restricted. /api/learning/me and consent/withdraw are unchanged.
  • GET /api/license/plan-fit (Cloud) was open to any member and names every connector and server. Now admin-when-restricted.
  • GET /api/adapters/popular-connectors and /starter-pack showed installed for every connector of the workspace. They now count only connectors the member can see.
  • POST /api/adapters/:slug/verify with connectorId: any EDITOR could test values against another member's stored credentials. Empty fields are filled from the stored connector. This is now owner-or-admin, with 404 for anyone else, in both modes. It is the only change that also affects open workspaces.
  • The items in priority 1 (audit server names, the shared-endpoint server links, key creation and key/connection server names, the consent page name, server write status codes) also came out of this inventory.

Docs and Swagger (priority 5): updated docs/operations/member-visibility.md (tables, a new "How a restricted member connects their AI client" section, a "Route decisions" section for contributors, the default-server caveat removed), docs/api-reference.md and docs/sso.md, plus the Swagger descriptions of every route touched.

Scope notes

  • roles/: only mcp-api-keys.controller.ts, mcp-api-keys.service.ts (serverFacts) and a MemberVisibilityModule import in roles.module.ts. No role-assignment code was changed, and nothing in settings/roles or admin/roles.
  • ee/: no file changed. The owner authorized minimal ee/file-search edits for this fix; none were needed.
  • Frontend: no change. The servers page, picker and logs page render the narrowed API answers as they are. On the logs page, a call through a hidden server shows like a shared-endpoint call.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

All commands ran in packages/backend after npm ci (repo root) and npx prisma generate. PostgreSQL was a throwaway postgres:17-alpine container, migrated with npx prisma migrate deploy.

Command Result
npx jest src/settings/member-visibility.routes.spec.ts --maxWorkers=2 14 passed
npx jest src/mcp-servers src/settings src/audit src/file-search src/adapters/adapters src/roles src/auth/login src/auth/server-picker src/mcp-server/shared-endpoint src/mcp-server/chatgpt-app src/mcp-server/file-search-app src/connectors/connectors.member-visibility --maxWorkers=2 First run: 6 suites failed on the intended behaviour change (they expected shared servers to be visible). I updated those specs and re-ran each one until it passed; all of them also pass in the full run below.
AUDIT_TEST_DATABASE_URL=… npx jest on the mcp-servers, connectors and audit member-visibility integration specs, --runInBand All pass after updating the specs to own-servers-only (connectors: 38, mcp-servers + audit: 73)
AUDIT_TEST_DATABASE_URL=… npx jest src/settings/member-visibility.restricted-viewer.integration.spec.ts --runInBand 11 passed (7 fail with the old serverWhere)
npm run lint / npm run lint:check 0 errors, 11 warnings, all pre-existing in files this PR does not touch; --fix changed nothing outside this PR's files
npx tsc --noEmit -p tsconfig.json clean
npx nest build, then booting dist/src/main.js against the test database "Nest application successfully started", /health 200, so the new module wiring resolves
Full backend suite: DATABASE_URL=… AUDIT_TEST_DATABASE_URL=… npx jest --maxWorkers=3 1306 suites passed, 7 skipped, 1 failed; 43904 tests passed, 1 failed

Baseline failure, not a regression: audit/tool-performance.integration.spec.ts › weights ERROR and TIMEOUT counts expects percentile_cont to give 285 and gets 284.99999999999994 on the local arm64 PostgreSQL 17. I swapped tool-performance.query.ts back to the origin/main version and it fails the same way there, so it is a float difference on this machine and not caused by this PR. The test is unchanged.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test). One baseline failure is described above.
  • This PR has a descriptive title

Known limits (not changed here)

  • MCP endpoint: roles still decide the tools. A connection granted to a team server before the switch keeps working. /mcp/<serverId> still answers any member who knows the id, with role-filtered tools.
  • Connector writes: a connector the member cannot see still answers 403 from the owner-or-admin check, not 404. This is the existing "writes are not part of this setting" decision.
  • Memory and knowledge folders: marked role-governed. They follow their own access model (memory access, folder roles, EDITOR curation) and member visibility does not narrow them further.
  • Aggregate counts: /api/license/usage still reports workspace totals.

Related Issues

Follow-up to #1664, #1665, #1666, #1667, #1668 and #1742 (member visibility).

Route → decision table

Decision Routes
no-member-session 97
scoped 52
workspace-config 22
own-data 51
owner-or-admin 29
admin-only 96
admin-when-restricted 10
role-governed 14
mcp-roles 14
total 385
Full route → decision table
Route Handler Decision Note
GET /api/adapters AdaptersPublicController.list no-member-session public catalog
GET /api/adapters/ranking/installs AdaptersPublicController.installRanking no-member-session public catalog, aggregate counts
GET /api/adapters/:slug/instructions AdaptersPublicController.instructions no-member-session public catalog
GET /api/adapters/popular-connectors AdaptersController.popularConnectors scoped installed only for connectors the member can see
GET /api/adapters/match-url AdaptersController.matchUrl workspace-config catalog lookup
GET /api/adapters/starter-pack AdaptersController.starterPack scoped installed only for connectors the member can see; plan usage counts
POST /api/adapters/starter-pack/install AdaptersController.installStarterPack own-data creates connectors owned by the caller
GET /api/adapters/:slug AdaptersController.getBySlug workspace-config catalog entry
POST /api/adapters/:slug/verify AdaptersController.verify owner-or-admin tries credentials; with connectorId only for its owner or an admin
POST /api/adapters/:slug/import AdaptersController.importAdapter own-data creates a connector owned by the caller
POST /api/setup-links/resolve SetupLinksController.resolve own-data the caller's own setup link (signed token)
POST /api/setup-links/open SetupLinksController.open no-member-session signed setup link
POST /api/telegram/manager-webhook TelegramManagedBotController.receive no-member-session Telegram webhook, secret token
POST /api/tiktok-shop/install TikTokShopInstallController.install own-data installs into a connector owned by the caller
GET /api/admin/settings/alert-webhook AlertsAdminController.getConfig admin-only
PUT /api/admin/settings/alert-webhook AlertsAdminController.saveConfig admin-only
DELETE /api/admin/settings/alert-webhook AlertsAdminController.deleteConfig admin-only
POST /api/admin/settings/alert-webhook/test AlertsAdminController.testWebhook admin-only
GET /api/audit/invocations AuditController.listInvocations scoped own calls only; servers named only when the member owns them
GET /api/audit/stats AuditController.getStats scoped own calls only
GET /api/audit/analytics AuditController.getAnalytics scoped own calls only
GET /api/audit/tool-performance AuditController.getToolPerformance scoped own calls only; servers named only when the member owns them
GET /api/audit/breakdowns AuditController.getBreakdowns scoped own calls only; byServer names only own servers, byUser only the caller
POST /api/product-events ProductEventController.record own-data records an event for the caller
GET /api/auth/attribution/click-ids SignupAttributionController.clickIds own-data
POST /api/auth/login/recovery AuthController.loginWithRecoveryCode no-member-session sign-in
POST /api/auth/login AuthController.login no-member-session sign-in
POST /api/auth/register AuthController.register no-member-session sign-up
POST /api/auth/verify-email AuthController.verifyEmail own-data
GET /api/auth/verify-email-link AuthController.verifyEmailLink no-member-session signed e-mail link
POST /api/auth/resend-verification AuthController.resendVerification own-data
POST /api/auth/invite AuthController.inviteUser admin-only
GET /api/auth/invite/verify AuthController.verifyInvite no-member-session invitation token
POST /api/auth/accept-invite AuthController.acceptInvite no-member-session invitation token
POST /api/auth/forgot-password AuthController.forgotPassword no-member-session sign-in
POST /api/auth/reset-password AuthController.resetPassword no-member-session reset token
GET /api/auth/recovery-codes AuthController.recoveryCodeStatus own-data
POST /api/auth/recovery-codes AuthController.generateRecoveryCodes own-data
GET /auth/login LoginController.showLoginPage no-member-session OAuth sign-in and consent page
GET /auth/social/:provider/callback LoginController.socialCallback no-member-session provider redirect, authenticated by the signed one-time state
POST /auth/login LoginController.handleLogin no-member-session OAuth sign-in
POST /auth/verify-email LoginController.handleEmailCode no-member-session OAuth sign-in
POST /auth/verify-email/resend LoginController.resendEmailCode no-member-session OAuth sign-in
POST /auth/verify-email/continue LoginController.continueAfterEmailLink no-member-session OAuth sign-in
POST /auth/verify-email/social/:provider LoginController.socialFromEmailCode no-member-session OAuth sign-in
POST /auth/file-search/session LoginController.fileSearchSetupSession no-member-session signed setup session
GET /auth/file-search/continue LoginController.fileSearchSetupContinue no-member-session signed setup session
POST /auth/select-servers LoginController.handleServerSelection scoped consent picker; offers and grants only servers McpConnectionGrantService lets the user see
POST /auth/first-app LoginController.pickFirstApp no-member-session OAuth consent flow
GET /auth/first-app/telegram/qr/:code LoginController.telegramOneTapQr no-member-session one-time code
POST /auth/first-app/telegram/status LoginController.telegramOneTapStatus no-member-session one-time code
POST /auth/first-app/telegram/token LoginController.telegramOneTapToken no-member-session one-time code
GET /api/auth/recent-sign-in RecentSignInController.who no-member-session signed device cookie
POST /api/auth/recent-sign-in RecentSignInController.continue no-member-session signed device cookie
DELETE /api/auth/recent-sign-in RecentSignInController.forget no-member-session signed device cookie
POST /api/auth/social/start SocialAuthController.start no-member-session sign-in
POST /api/auth/social/exchange SocialAuthController.exchange no-member-session sign-in
GET /api/auth/social/identities SocialAuthController.identities own-data
POST /api/auth/social/link/:provider SocialAuthController.link own-data
DELETE /api/auth/social/link/:provider SocialAuthController.unlink own-data
GET /userinfo UserInfoController.get own-data OIDC userinfo of the token holder
POST /userinfo UserInfoController.post own-data OIDC userinfo of the token holder
GET /api/connectors ConnectorsController.list scoped owned or holding an allowed tool; reduced view for the ones not owned
POST /api/connectors ConnectorsController.create own-data creates a connector owned by the caller
GET /api/connectors/proxy-availability ConnectorsController.proxyAvailability workspace-config
GET /api/connectors/health-check ConnectorsController.healthCheck scoped visible connectors only; fixed message for the ones not owned
GET /api/connectors/export-all ConnectorsController.exportAll scoped only connectors the member owns
GET /api/connectors/:id/export ConnectorsController.exportOne scoped 404 unless the member owns the connector
GET /api/connectors/:id ConnectorsController.findOne scoped hidden connector answers 404; a visible one it does not own comes back in the reduced view; its MCP servers only when the member owns them
GET /api/connectors/:id/webhook/url ConnectorsController.webhookUrl scoped owner or admin; a connector the member cannot see answers 404 first
GET /api/connectors/:id/webhook/events ConnectorsController.webhookEventsList scoped owner or admin; a connector the member cannot see answers 404 first
PUT /api/connectors/:id ConnectorsController.update owner-or-admin
GET /api/connectors/:id/oauth-config ConnectorsController.getOAuthConfig scoped 404 unless the member owns the connector
PATCH /api/connectors/:id/credential-scope ConnectorsController.updateCredentialScope owner-or-admin
GET /api/connectors/:id/my-credential ConnectorsController.getMyCredential scoped the caller's own credential; hidden connector answers 404
DELETE /api/connectors/:id/my-credential ConnectorsController.deleteMyCredential scoped the caller's own credential; hidden connector answers 404
PATCH /api/connectors/:id/oauth-config ConnectorsController.updateOAuthConfig owner-or-admin
PATCH /api/connectors/:id/oauth1-config ConnectorsController.updateOAuth1Config owner-or-admin
DELETE /api/connectors/:id ConnectorsController.remove owner-or-admin
POST /api/connectors/:id/test ConnectorsController.test scoped owner or admin; a connector the member cannot see answers 404 first
GET /api/connectors/oauth/redirect-uri ConnectorsController.oauthRedirectUri workspace-config
POST /api/connectors/:id/oauth/authorize ConnectorsController.initiateOAuth scoped owner or admin, or the caller's own per-user sign-in; hidden answers 404
POST /api/connectors/:id/discover-tools ConnectorsController.discoverMcpTools owner-or-admin
POST /api/connectors/import-all ConnectorsController.importAll own-data creates connectors owned by the caller
POST /api/connectors/import ConnectorsController.importFile own-data creates connectors owned by the caller
POST /api/connectors/:id/import-spec ConnectorsController.importSpec owner-or-admin
POST /api/connectors/:id/import ConnectorsController.importTools owner-or-admin
PUT /api/connectors/:id/env-vars ConnectorsController.updateEnvVars owner-or-admin
GET /api/connectors/:id/catalog-diff ConnectorsController.catalogDiff scoped owner or admin; a connector the member cannot see answers 404 first
POST /api/connectors/:id/resync-catalog ConnectorsController.resyncCatalog owner-or-admin
GET /api/iop-auth/redirect-uri IopAuthController.redirectUri workspace-config
POST /api/iop-auth/connectors/:id/authorize IopAuthController.authorize owner-or-admin
GET /api/iop-auth/callback IopAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/iop-auth/complete IopAuthController.complete own-data completes the caller's own pending flow
POST /api/mcp-oauth/callback McpOAuthCallbackController.acknowledgeNotification no-member-session provider notification
GET /api/mcp-oauth/callback McpOAuthCallbackController.oauthCallback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/mcp-oauth/complete McpOAuthCallbackController.complete own-data completes the caller's own pending flow
GET /auth/connect/complete McpOAuthCallbackController.connectPageComplete no-member-session provider redirect, authenticated by the signed one-time state
GET /auth/connect/:connectorId McpOAuthCallbackController.connectPage no-member-session per-user sign-in page of a connector link, its own session
POST /auth/connect/:connectorId/sso/:providerId McpOAuthCallbackController.connectPageSignIn no-member-session per-user sign-in page of a connector link
POST /auth/connect/:connectorId/connect McpOAuthCallbackController.connectPageConnect no-member-session per-user sign-in page of a connector link
POST /auth/connect/:connectorId/switch McpOAuthCallbackController.connectPageSwitch no-member-session per-user sign-in page of a connector link
GET /api/meta/platform MetaAuthController.platform workspace-config
POST /api/meta/connectors/:id/authorize MetaAuthController.authorize owner-or-admin
GET /api/meta/callback MetaAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/meta/complete MetaAuthController.complete own-data completes the caller's own pending flow
GET /api/meta/connectors/:id/accounts MetaAuthController.listAccounts owner-or-admin
POST /api/meta/connectors/:id/account MetaAuthController.chooseAccount owner-or-admin
GET /api/shein-auth/redirect-uri SheinAuthController.redirectUri workspace-config
POST /api/shein-auth/connectors/:id/authorize SheinAuthController.authorize owner-or-admin
GET /api/shein-auth/callback SheinAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/shein-auth/complete SheinAuthController.complete own-data completes the caller's own pending flow
POST /api/shopee/connectors/:id/authorize ShopeeAuthController.authorize owner-or-admin
GET /api/shopee/callback/:state ShopeeAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/shopee/complete ShopeeAuthController.complete own-data completes the caller's own pending flow
GET /api/tiktok-shop/platform TikTokShopAuthController.platform workspace-config
POST /api/tiktok-shop/connectors/:id/authorize TikTokShopAuthController.authorize owner-or-admin
GET /api/tiktok-shop/callback TikTokShopAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
POST /api/tiktok-shop/complete TikTokShopAuthController.complete own-data completes the caller's own pending flow
GET /api/connectors/:connectorId/tools ToolsController.list scoped allowed tools only on a connector the member does not own; hidden answers 404
POST /api/connectors/:connectorId/tools ToolsController.create owner-or-admin
POST /api/connectors/:connectorId/tools/bulk ToolsController.bulkCreate owner-or-admin
PUT /api/connectors/:connectorId/tools/:toolId ToolsController.update owner-or-admin
GET /api/connectors/:connectorId/tools/:toolId/annotations ToolsController.getAnnotations scoped owner or admin; a connector the member cannot see answers 404 first
PATCH /api/connectors/:connectorId/tools/:toolId/annotations ToolsController.setAnnotations owner-or-admin
GET /api/connectors/:connectorId/tools/:toolId/response-mapping ToolsController.getResponseMapping scoped owner or admin; a connector the member cannot see answers 404 first
PATCH /api/connectors/:connectorId/tools/:toolId/response-mapping ToolsController.setResponseMapping owner-or-admin
POST /api/connectors/:connectorId/tools/:toolId/preview-mapping ToolsController.previewMapping owner-or-admin
PATCH /api/connectors/:connectorId/tools/:toolId/proxy ToolsController.setProxy owner-or-admin
POST /api/connectors/:connectorId/tools/:toolId/test ToolsController.testTool owner-or-admin
DELETE /api/connectors/:connectorId/tools/:toolId ToolsController.remove owner-or-admin
POST /api/webhooks/:connectorId WebhookIngestController.receive no-member-session provider webhook, signature checked
GET /api/woocommerce/one-click WooCommerceAuthController.oneClick own-data starts the caller's own install flow
POST /api/woocommerce/connectors/:id/authorize WooCommerceAuthController.authorize owner-or-admin
POST /api/woocommerce/callback WooCommerceAuthController.callback no-member-session provider redirect, authenticated by the signed one-time state
GET /api/woocommerce/connectors/:id/one-click-status WooCommerceAuthController.oneClickStatus own-data status of the caller's own pending flow
POST /api/cron/kg-discovery KgCronController.run no-member-session cron secret
POST /api/cron/onboarding-reminders OnboardingCronController.run no-member-session cron secret
GET /api/learning/allowance LearningController.allowance workspace-config plan allowance and counts
GET /api/learning/me LearningController.mine own-data the caller's own learning projects
POST /api/learning/projects/:id/consent LearningController.consent own-data the caller's own learning project
POST /api/learning/projects/:id/withdraw LearningController.withdraw own-data the caller's own learning project
GET /api/learning/projects LearningController.list admin-when-restricted other members' learning projects
POST /api/learning/projects LearningController.create admin-only
GET /api/learning/projects/:id LearningController.get admin-when-restricted another member's learning project
PATCH /api/learning/projects/:id LearningController.update admin-only
POST /api/learning/projects/:id/pause LearningController.pause admin-only
POST /api/learning/projects/:id/resume LearningController.resume admin-only
POST /api/learning/projects/:id/end LearningController.end admin-only
DELETE /api/learning/projects/:id LearningController.remove admin-only
GET /api/learning/projects/:id/lessons LearningController.lessons admin-when-restricted lessons drawn from another member's requests
PATCH /api/learning/lessons/:id LearningController.setLesson admin-when-restricted lessons drawn from another member's requests
POST /api/learning/projects/:id/topics LearningController.addTopic admin-only
PATCH /api/learning/topics/:id LearningController.updateTopic admin-only
GET /api/learning/topics/:id/preview LearningController.preview admin-when-restricted skill text drawn from another member's lessons
POST /api/learning/topics/:id/publish LearningController.publish admin-when-restricted publishes another member's lessons
GET /api/license/edition EditionController.getEdition workspace-config edition and user limit
POST /api/license/business-trial EditionController.startTrial admin-only
GET /api/support/widget SupportController.widget own-data support identity of the caller
POST /api/support/webhook SupportController.webhook no-member-session support desk webhook, secret
POST /api/support/desk-tools/connector SupportController.deskConnector no-member-session support desk, secret
GET /api/file-search/capabilities FileSearchController.capabilities workspace-config plan, limits, worker health and aggregate usage
POST /api/file-search/test FileSearchController.test admin-only FileSearchService.assertAdmin
POST /api/file-search/connectors FileSearchController.createDraft admin-only FileSearchService.assertAdmin
GET /api/file-search/policy FileSearchController.getPolicy workspace-config
PUT /api/file-search/policy FileSearchController.setPolicy admin-only FileSearchService.assertAdmin
GET /api/file-search/connectors/:id FileSearchController.overview scoped 404 unless the member owns the connector (File Search detail is never shared)
PUT /api/file-search/connectors/:id/source FileSearchController.updateSource scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/scans FileSearchController.startScan scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-search/connectors/:id/scans/:scanId FileSearchController.getScan scoped 404 unless the member owns the connector (File Search detail is never shared)
DELETE /api/file-search/connectors/:id/scans/:scanId FileSearchController.cancelScan scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/scans/:scanId/describe FileSearchController.redescribe scoped 404 unless the member owns the connector (File Search detail is never shared)
PUT /api/file-search/connectors/:id/selection FileSearchController.setSelection scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/activate FileSearchController.activate scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-search/connectors/:id/tree FileSearchController.tree scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-search/connectors/:id/problems FileSearchController.problems scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-search/connectors/:id/runs FileSearchController.runs scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/sync FileSearchController.syncNow scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/pause FileSearchController.pause scoped 404 unless the member owns the connector (File Search detail is never shared)
POST /api/file-search/connectors/:id/resume FileSearchController.resume scoped 404 unless the member owns the connector (File Search detail is never shared)
PUT /api/file-search/connectors/:id/schedule FileSearchController.schedule scoped 404 unless the member owns the connector (File Search detail is never shared)
PUT /api/file-search/connectors/:id/description FileSearchController.description scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-search/connectors/:id/access-rules FileSearchController.getRules scoped 404 unless the member owns the connector (File Search detail is never shared)
PUT /api/file-search/connectors/:id/access-rules FileSearchController.setRules scoped 404 unless the member owns the connector (File Search detail is never shared)
GET /api/file-share FileShareController.list own-data a member gets only their own links; usage counts and the built-in File Share connector
DELETE /api/file-share/:id FileShareController.revoke owner-or-admin FileShareService.revoke
POST /api/file-share/connector FileShareController.createConnector admin-only checked in the handler
GET /api/file-share/s/:token FileShareController.describe no-member-session share token
POST /api/file-share/s/:token/download FileShareController.download no-member-session share token
POST /api/file-share/s/:token/download-internal FileShareController.downloadInternal no-member-session share token, plus a signed-in member of the workspace
GET /api/file-share/d/:signed FileShareController.stream no-member-session signed download link
GET /api/file-share/limits FileShareController.limits workspace-config limits and aggregate usage
GET /api/uploads/u/:token FileUploadController.status no-member-session upload token
PUT /api/uploads/u/:token FileUploadController.put no-member-session upload token
POST /api/uploads/u/:token FileUploadController.post no-member-session upload token
GET /api/uploads/f/:signed/:name FileUploadController.download no-member-session signed download link
GET /health/server-info HealthController.getServerInfo no-member-session public health
GET /health HealthController.check no-member-session public health
GET /health/sentry-verify SentryVerifyController.verify no-member-session operator check
GET /api/version VersionController.getVersion workspace-config version
GET /api/identity-providers IdentityProvidersController.list admin-only
GET /api/identity-providers/:id IdentityProvidersController.get admin-only
POST /api/identity-providers IdentityProvidersController.create admin-only
PUT /api/identity-providers/:id IdentityProvidersController.update admin-only
DELETE /api/identity-providers/:id IdentityProvidersController.remove admin-only
GET /api/identity-providers/:id/role-mappings IdentityProvidersController.listRoleMappings admin-only
PUT /api/identity-providers/:id/role-mappings IdentityProvidersController.replaceRoleMappings admin-only
PUT /api/identity-providers/:id/enforce-sso IdentityProvidersController.setEnforceSso admin-only
POST /api/identity-providers/:id/resync-roles IdentityProvidersController.resyncRoles admin-only
GET /api/identity-providers/:id/scim IdentityProvidersController.scimStatus admin-only
PUT /api/identity-providers/:id/scim IdentityProvidersController.setScim admin-only
POST /api/identity-providers/:id/scim/rotate IdentityProvidersController.rotateScim admin-only
DELETE /api/identity-providers/:id/scim IdentityProvidersController.removeScim admin-only
POST /api/identity-providers/:id/test IdentityProvidersController.test admin-only
GET /api/scim/v2/ServiceProviderConfig ScimController.serviceProviderConfig no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/ResourceTypes ScimController.resourceTypes no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/ResourceTypes/:name ScimController.resourceType no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Schemas ScimController.schemas no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Schemas/:uri ScimController.schema no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Users ScimController.listUsers no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Users/:id ScimController.getUser no-member-session SCIM bearer token of an identity provider
POST /api/scim/v2/Users ScimController.createUser no-member-session SCIM bearer token of an identity provider
PUT /api/scim/v2/Users/:id ScimController.replaceUser no-member-session SCIM bearer token of an identity provider
PATCH /api/scim/v2/Users/:id ScimController.patchUser no-member-session SCIM bearer token of an identity provider
DELETE /api/scim/v2/Users/:id ScimController.deleteUser no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Groups ScimController.listGroups no-member-session SCIM bearer token of an identity provider
GET /api/scim/v2/Groups/:id ScimController.getGroup no-member-session SCIM bearer token of an identity provider
POST /api/scim/v2/Groups ScimController.createGroup no-member-session SCIM bearer token of an identity provider
PUT /api/scim/v2/Groups/:id ScimController.replaceGroup no-member-session SCIM bearer token of an identity provider
PATCH /api/scim/v2/Groups/:id ScimController.patchGroup no-member-session SCIM bearer token of an identity provider
DELETE /api/scim/v2/Groups/:id ScimController.deleteGroup no-member-session SCIM bearer token of an identity provider
GET /sso/:initiateId SsoController.start no-member-session SSO sign-in
GET /auth/sso/callback SsoController.callback no-member-session SSO sign-in
POST /api/auth/sso/link/:providerId SsoController.startLink own-data
DELETE /api/auth/sso/link/:providerId SsoController.unlink own-data
GET /api/auth/sso/providers SsoController.myProviders workspace-config the workspace's sign-in options, and whether the caller linked each
POST /api/auth/sso/exchange SsoController.exchange no-member-session one-time sign-in code
GET /api/knowledge-folders KnowledgeFoldersController.list role-governed folders the caller's roles may see
POST /api/knowledge-folders KnowledgeFoldersController.create role-governed ADMIN or EDITOR
PATCH /api/knowledge-folders/:id KnowledgeFoldersController.update role-governed ADMIN or EDITOR
DELETE /api/knowledge-folders/:id KnowledgeFoldersController.remove role-governed ADMIN or EDITOR
PUT /api/knowledge-folders/:id/roles KnowledgeFoldersController.setRoles admin-only
POST /api/knowledge-folders/move KnowledgeFoldersController.move role-governed ADMIN or EDITOR
GET /api/knowledge-graph KgController.getGraph admin-when-restricted nodes and links of every connector and tool
GET /api/knowledge-graph/stats KgController.stats role-governed ADMIN or EDITOR; counts only
GET /api/knowledge-graph/settings KgController.getSettings role-governed ADMIN or EDITOR; whether the graph is on
PUT /api/knowledge-graph/settings KgController.setSettings admin-only
POST /api/knowledge-graph/enrich KgController.enrich admin-only
GET /api/knowledge-graph/skills KgController.listSkills admin-when-restricted skills learned from every member's requests
POST /api/knowledge-graph/skills KgController.createSkill admin-only
POST /api/knowledge-graph/skills/generate KgController.generateSkills admin-only
POST /api/knowledge-graph/skills/propose-from-errors KgController.proposeFromErrors admin-only
POST /api/knowledge-graph/skills/consolidate KgController.consolidateSkills admin-only
POST /api/knowledge-graph/skills/:id/apply KgController.applySkill admin-only
POST /api/knowledge-graph/skills/:id/dismiss KgController.dismissSkill admin-only
PATCH /api/knowledge-graph/skills/:id KgController.updateSkill admin-only
GET /api/knowledge-graph/skills/:id/versions KgController.skillVersions admin-when-restricted skills learned from every member's requests
GET /api/knowledge-graph/learning/me KgController.getMyLearning own-data
PUT /api/knowledge-graph/learning/me KgController.setMyLearning own-data
PUT /api/knowledge-graph/learning/members KgController.setMembersLearning admin-only
DELETE /api/knowledge-graph/skills/:id KgController.deleteSkill admin-only
POST /api/knowledge-graph/rebuild KgController.rebuild admin-only
POST /api/knowledge-graph/nodes KgController.createNode admin-only
POST /api/knowledge-graph/edges KgController.createEdge admin-only
PATCH /api/knowledge-graph/edges/:id KgController.updateEdge admin-only
DELETE /api/knowledge-graph/edges/:id KgController.deleteEdge admin-only
PATCH /api/knowledge-graph/nodes/:id KgController.updateNode admin-only
DELETE /api/knowledge-graph/nodes/:id KgController.deleteNode admin-only
GET /api/memory/status MemoryController.status role-governed licence, the caller's memory access and the workspace settings
GET /api/memory/items MemoryController.list role-governed personal: the caller's own; company: by memory access and folder roles
POST /api/memory/items MemoryController.create role-governed personal: the caller's own; company: by memory access
PATCH /api/memory/items/:id MemoryController.update role-governed the caller's own item, or a curator
DELETE /api/memory/items/:id MemoryController.remove role-governed the caller's own item, or a curator
POST /api/memory/items/:id/approve MemoryController.approve role-governed ADMIN or EDITOR curators
POST /api/memory/items/:id/reject MemoryController.reject role-governed ADMIN or EDITOR curators
PUT /api/memory/settings MemoryController.updateSettings admin-only
PUT /api/memory/members/access MemoryController.setAccess admin-only
DELETE /api/memory/members/:userId/personal MemoryController.erasePersonal admin-only
GET /api/license/status LicenseController.getStatus workspace-config licence state
POST /api/license/refresh LicenseController.refresh admin-only
POST /api/license/sync LicenseController.syncFromSite no-member-session licence site, signed request
GET /api/license/instance-id LicenseController.getInstanceId workspace-config
GET /api/license/usage LicenseController.getUsage workspace-config aggregate counts of connectors, servers and users
PUT /api/license/key LicenseController.setLicenseKey admin-only
POST /api/license/billing-portal LicenseController.billingPortal admin-only
GET /api/license/invoice-email LicenseController.getInvoiceEmail admin-only
PUT /api/license/invoice-email LicenseController.setInvoiceEmail admin-only
POST /api/license/dpa-link LicenseController.dpaLink admin-only
POST /api/license/checkout-link LicenseController.checkoutLink admin-only
GET /api/license/pricing-link-token LicenseController.pricingLinkToken own-data token for the caller's own address
GET /api/license/card-trial-eligibility LicenseController.cardTrialEligibilityForUser admin-only
GET /api/license/card-trial-offer LicenseController.cardTrialOfferForUser workspace-config null for members who are not admins
GET /api/license/plan-fit LicenseController.planFitForUser admin-when-restricted names every connector and MCP server of the workspace
GET /api/license/wall LicenseController.wallForUser admin-only null unless the caller is an admin (checked in the handler)
POST /api/license/verify LicenseController.verifyLicense admin-only
POST /api/license/activate-trial LicenseController.activateTrial workspace-config starts the workspace trial; answers licence state
POST /api/license/register-community LicenseController.registerCommunity admin-only
GET /api/license/reactivate/:token ReactivationController.view no-member-session reactivation token
POST /api/license/reactivate/:token/checkout ReactivationController.checkout no-member-session reactivation token
POST /api/license/reactivate/:token/event ReactivationController.event no-member-session reactivation token
GET /api/license/extend TrialExtensionController.confirm no-member-session signed e-mail link
POST /api/license/extend TrialExtensionController.extend no-member-session signed e-mail link
POST /mcp McpEndpointController.handleGlobalPost mcp-roles
GET /mcp McpEndpointController.handleGlobalGet mcp-roles
DELETE /mcp McpEndpointController.handleGlobalDelete mcp-roles
POST /mcp/chatgpt-app McpEndpointController.handleChatgptAppPost mcp-roles
GET /mcp/chatgpt-app McpEndpointController.handleChatgptAppGet mcp-roles
DELETE /mcp/chatgpt-app McpEndpointController.handleChatgptAppDelete mcp-roles
POST /mcp/file-search McpEndpointController.handleFileSearchAppPost mcp-roles
GET /mcp/file-search McpEndpointController.handleFileSearchAppGet mcp-roles
DELETE /mcp/file-search McpEndpointController.handleFileSearchAppDelete mcp-roles
POST /mcp/demo McpEndpointController.handleDemoPost mcp-roles
GET /mcp/demo McpEndpointController.handleDemoGet mcp-roles
POST /mcp/:serverId McpEndpointController.handlePost mcp-roles
GET /mcp/:serverId McpEndpointController.handleGet mcp-roles
DELETE /mcp/:serverId McpEndpointController.handleDelete mcp-roles
POST /internal/registry/catch-up RegistryCatchUpController.catchUp no-member-session internal secret
GET /.well-known/openai-apps-challenge WellKnownOAuthController.openaiAppsChallenge no-member-session public discovery
GET /.well-known/openid-configuration WellKnownOAuthController.openidConfiguration no-member-session public discovery
GET /.well-known/openid-configuration/mcp/:serverId WellKnownOAuthController.openidConfigurationScoped no-member-session public discovery
GET /.well-known/oauth-authorization-server/mcp/:serverId WellKnownOAuthController.authorizationServerScoped no-member-session public discovery
GET /.well-known/oauth-protected-resource/mcp WellKnownOAuthController.protectedResourceShared no-member-session public discovery
GET /.well-known/oauth-protected-resource/mcp/:serverId WellKnownOAuthController.protectedResourceScoped no-member-session public discovery
GET /api/mcp-connections McpConnectionsController.list own-data the caller's grants; a granted server is named only when visible to them
GET /api/mcp-connections/targets McpConnectionsController.targets scoped per workspace, via McpConnectionGrantService: only own servers
PUT /api/mcp-connections/:clientId McpConnectionsController.update scoped via McpConnectionGrantService: a hidden server is dropped like an unknown id
DELETE /api/mcp-connections/:clientId McpConnectionsController.revoke own-data
GET /api/mcp-servers McpServersController.list scoped only servers the member owns, with only the connectors they can see
POST /api/mcp-servers McpServersController.create own-data creates a server owned by the caller; refused to a VIEWER
GET /api/mcp-servers/:id McpServersController.get scoped 404 unless the member owns the server
GET /api/mcp-servers/:id/activity McpServersController.activity scoped 404 unless the member owns the server
PUT /api/mcp-servers/:id McpServersController.update scoped 404 unless the member owns the server; then owner or admin
DELETE /api/mcp-servers/:id McpServersController.delete scoped 404 unless the member owns the server; then owner or admin
PUT /api/mcp-servers/:id/connectors McpServersController.assignConnectors scoped 404 for a server not owned and for a connector the member cannot see
GET /api/organizations/mine OrganizationsController.listMine own-data the caller's memberships
GET /api/organizations/current OrganizationsController.getCurrent workspace-config the workspace row
PUT /api/organizations/current OrganizationsController.updateCurrent admin-only checked in the handler
DELETE /api/organizations/current OrganizationsController.deleteCurrent admin-only checked in the handler
POST /api/organizations/current/revoke-sessions OrganizationsController.revokeWorkspaceSessions admin-only checked in the handler
POST /api/organizations/switch OrganizationsController.switchOrg own-data switches the caller's active workspace
POST /api/organizations OrganizationsController.createOrg own-data creates a workspace the caller owns
GET /api/public/stats PublicStatsController.getStats no-member-session public aggregate counts
GET /api/mcp-keys McpApiKeysController.listKeys scoped the caller's own keys; mcpServer null for a server they may not see
POST /api/mcp-keys McpApiKeysController.generateKey scoped a key for a server the member may not see answers 404
POST /api/mcp-keys/:id/revoke McpApiKeysController.revokeKey own-data
DELETE /api/mcp-keys/:id McpApiKeysController.deleteKey own-data
GET /api/roles RolesController.listRoles admin-only
POST /api/roles RolesController.createRole admin-only
GET /api/roles/:id RolesController.getRole admin-only
PUT /api/roles/:id RolesController.updateRole admin-only
DELETE /api/roles/:id RolesController.deleteRole admin-only
GET /api/roles/:id/tools RolesController.getToolAccess admin-only
PUT /api/roles/:id/tools RolesController.setToolAccess admin-only
PUT /api/roles/:id/tools/:toolId/rate-limit RolesController.setToolRateLimits admin-only
PUT /api/roles/assign/:userId RolesController.assignRole admin-only
GET /api/roles/assignments/:userId RolesController.getAssignments admin-only
PUT /api/roles/assignments/:userId RolesController.setAssignments admin-only
GET /api/settings/member-visibility MemberVisibilityMemberController.getMemberVisibility own-data the mode and whether it narrows the caller
PUT /api/admin/settings/member-visibility MemberVisibilityAdminController.setMemberVisibility admin-only
GET /api/site-settings/footer-links SiteSettingsPublicController.getFooterLinks no-member-session public footer links
GET /api/settings/footer-links SiteSettingsMemberController.getFooterLinks workspace-config footer links
GET /api/admin/settings/smtp SiteSettingsAdminController.getSmtpConfig admin-only
PUT /api/admin/settings/smtp SiteSettingsAdminController.updateSmtpConfig admin-only
DELETE /api/admin/settings/smtp SiteSettingsAdminController.deleteSmtpConfig admin-only
POST /api/admin/settings/smtp/test SiteSettingsAdminController.testSmtp admin-only
GET /api/admin/settings/footer-links SiteSettingsAdminController.getFooterLinks admin-only
PUT /api/admin/settings/footer-links SiteSettingsAdminController.updateFooterLinks admin-only
GET /api/admin/settings/ssrf-allowed-hosts SiteSettingsAdminController.getSsrfAllowedHosts admin-only
PUT /api/admin/settings/ssrf-allowed-hosts SiteSettingsAdminController.setSsrfAllowedHosts admin-only
GET /api/public/unsubscribe UnsubscribeController.confirm no-member-session signed unsubscribe link
POST /api/public/unsubscribe UnsubscribeController.unsubscribe no-member-session signed unsubscribe link
GET /api/users/me UsersController.getProfile own-data
GET /api/users/me/onboarding-state UsersController.getOnboardingState own-data
PATCH /api/users/me/onboarding-state UsersController.updateOnboardingState own-data
PUT /api/users/me UsersController.updateProfile own-data
DELETE /api/users/me UsersController.deleteSelf own-data
PUT /api/users/me/password UsersController.changePassword own-data
GET /api/users UsersController.listUsers admin-only
GET /api/users/invitations UsersController.listInvitations admin-only
DELETE /api/users/invitations/:id UsersController.deleteInvitation admin-only
PUT /api/users/:id/role UsersController.updateRole admin-only
POST /api/users/:id/revoke-sessions UsersController.revokeUserSessions admin-only
POST /api/users/:id/deactivate UsersController.deactivateUser admin-only
POST /api/users/:id/reactivate UsersController.reactivateUser admin-only
DELETE /api/users/:id UsersController.deleteUser admin-only

In a restricted workspace a member who is not an admin used to see every
MCP server holding a connector they could see, with its name, owner,
connectors, endpoint and usage. They now see only the servers they own,
on every route that lists, reads, counts or reports servers: the servers
API (reads and writes answer the unknown-id 404), the server picker and
consent page, connections, API keys, connector detail, the audit log,
tool performance and breakdowns, and the server links on the shared MCP
endpoint. A restricted member with only their own server is granted the
workspace connection, where their roles decide the tools.

File Search detail routes answer 404 unless the member owns the
connector, also for one shared through their roles. The catalog's
installed flags count only connectors the member can see, and testing
values for an existing connector is limited to its owner or an admin.
member-visibility.routes.ts records, for each controller handler, what
a member who is not an admin gets in a restricted workspace. A spec
reads every controller through Nest route metadata and fails on a route
without a decision or a decision without a route, and checks admin-only
and scoped decisions against the code.

MemberVisibilityInterceptor enforces the admin-when-restricted
decisions (knowledge graph and skills reads, learning projects, plan
fit) without changing those controllers. An integration spec runs the
restricted VIEWER scenario against PostgreSQL.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant