Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): check the specific scope for scripts, preview input, and full-access MCP grants #17772

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/17772/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 30 additions and 2 deletions (loading 7).

x
0 of 10 viewed, 10 left
14 additions and 2 deletionsapps/server/src/auth/EnvironmentAuth.tsModified
View file
@@ -4,6 +4,8 @@
AuthAdministrativeScopes,
AuthOrchestrationOperateScope,
AuthOrchestrationReadScope,
+ AuthSettingsWriteScope,
+ AuthSourceControlWriteScope,
AuthStandardClientScopes,
type AuthAccessTokenResult,
type AuthBrowserSessionResult,
@@ -74,7 +76,10 @@
* token cannot reach the full RPC surface around that cap.
* A read-only grant holds `orchestration:read` alone. Any other grant also
- * holds `orchestration:operate` and carries its runtime-mode ceiling.
+ * holds `orchestration:operate` and carries its runtime-mode ceiling. A
+ * full-access client may also change environment preferences and clone
+ * repositories, so it holds the scopes those need over RPC. Approving a grant
+ * requires every scope it holds.
*/
const MCP_CLIENT_SUBJECT = "mcp-client";
const MCP_CLIENT_SESSION_TTL = Duration.days(30);
@@ -84,7 +89,14 @@
): ReadonlyArray<AuthEnvironmentScope> =>
access === "read-only"
? [AuthOrchestrationReadScope]
- : [AuthOrchestrationReadScope, AuthOrchestrationOperateScope];
+ : access === "full-access"
+ ? [