File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
components/server/src/oauth-server Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ function createVSCodeClient(protocol: "vscode" | "vscode-insiders"): OAuthClient
67
67
{ name : "function:getGitpodTokenScopes" } ,
68
68
{ name : "function:getLoggedInUser" } ,
69
69
{ name : "function:accessCodeSyncStorage" } ,
70
+ { name : "function:getOwnerToken" } ,
71
+ { name : "function:getWorkspace" } ,
72
+ { name : "function:getWorkspaces" } ,
70
73
{ name : "resource:default" } ,
71
74
] ,
72
75
} ;
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ export const inMemoryScopeRepository: OAuthScopeRepository = {
48
48
client : OAuthClient ,
49
49
user_id ?: string ,
50
50
) : Promise < OAuthScope [ ] > {
51
- return scopes ;
51
+ const clientScopes = client . scopes . map ( ( s ) => s . name ) ;
52
+ if ( scopes . every ( ( s ) => clientScopes . includes ( s . name ) ) ) {
53
+ return scopes ;
54
+ }
55
+
56
+ throw new Error ( "Requested scopes not allowed" ) ;
52
57
} ,
53
58
} ;
You can’t perform that action at this time.
0 commit comments