Skip to content

e2e: a member cannot run a connection as the owner's account (#15) - #60

Merged
shuv1337 merged 1 commit into
v2from
shuv/runsas-substitution-e2e-20261023
Oct 23, 2026
Merged

shuv1337 merged 1 commit into
v2from
shuv/runsas-substitution-e2e-20261023

Conversation

@shuv1337

Copy link
Copy Markdown
Owner

Test-only. Adds the saved-profile (runsAs) substitution evidence that #15's acceptance asks for. No product or runtime change.

What it proves. In "Scoped connections run apps only as the selected accounts and link bare accounts" (scopedConnectionAccounts):

  1. The owner shares the app with everyone.
  2. A member saves an MCP connection whose runsAs names the owner's personal work account.
  3. The product route refuses it: 400 ConnectionAccessInvalid with reason account, not app, so the app check passed and the account check refused.
  4. Nothing is linked for the member.

The same scenario already covers the in-call substitutions:

  • naming another account with $accounts fails with AccountChoiceUnsupported;
  • an account linked in place of the connection's is refused.

hostedMcpLinkHeldAccess covers the race where account access is withdrawn while a save waits. This step covers the simpler case: another person's account named up front.

Limits. Native requests (#16) are out of scope.

Run locally: bun run e2e:self-host --test-name 'Scoped connections run apps only as the selected accounts and link bare accounts' passed (1 passed). bun run check passed. The scenario's Cloud target runs in deployed tests.

mcp-connections.spec.ts

A member who can use the app saves an MCP connection whose runsAs names
the owner's personal account. The product route refuses it with
ConnectionAccessInvalid (reason account) and links nothing for the member,
so a swapped saved profile cannot impersonate another principal.
@shuv1337
shuv1337 merged commit 991910d into v2 Oct 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant