@@ -7,7 +7,6 @@ import { flatten } from 'vs/base/common/arrays';
7
7
import { Emitter , Event } from 'vs/base/common/event' ;
8
8
import { IJSONSchema } from 'vs/base/common/jsonSchema' ;
9
9
import { Disposable , dispose , IDisposable , MutableDisposable } from 'vs/base/common/lifecycle' ;
10
- import { isWeb } from 'vs/base/common/platform' ;
11
10
import { isFalsyOrWhitespace } from 'vs/base/common/strings' ;
12
11
import { isString } from 'vs/base/common/types' ;
13
12
import * as nls from 'vs/nls' ;
@@ -26,7 +25,6 @@ import { AuthenticationProviderInformation, AuthenticationSession, Authenticatio
26
25
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService' ;
27
26
import { ActivationKind , IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
28
27
import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
29
- import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
30
28
31
29
export function getAuthenticationProviderActivationEvent ( id : string ) : string { return `onAuthenticationRequest:${ id } ` ; }
32
30
@@ -36,16 +34,6 @@ interface IAccountUsage {
36
34
lastUsed : number ;
37
35
}
38
36
39
- const FIRST_PARTY_ALLOWED_EXTENSIONS = [
40
- 'vscode.git' ,
41
- 'vscode.github' ,
42
- 'github.vscode-pull-request-github' ,
43
- 'github.remotehub' ,
44
- 'github.remotehub-insiders' ,
45
- 'github.codespaces' ,
46
- 'ms-vsliveshare.vsliveshare'
47
- ] ;
48
-
49
37
export function readAccountUsages ( storageService : IStorageService , providerId : string , accountName : string , ) : IAccountUsage [ ] {
50
38
const accountKey = `${ providerId } -${ accountName } -usages` ;
51
39
const storedUsages = storageService . get ( accountKey , StorageScope . APPLICATION ) ;
@@ -204,9 +192,9 @@ export class AuthenticationService extends Disposable implements IAuthentication
204
192
@IActivityService private readonly activityService : IActivityService ,
205
193
@IExtensionService private readonly extensionService : IExtensionService ,
206
194
@IStorageService private readonly storageService : IStorageService ,
207
- @IRemoteAgentService private readonly remoteAgentService : IRemoteAgentService ,
208
195
@IDialogService private readonly dialogService : IDialogService ,
209
- @IQuickInputService private readonly quickInputService : IQuickInputService
196
+ @IQuickInputService private readonly quickInputService : IQuickInputService ,
197
+ @IProductService private readonly productService : IProductService ,
210
198
) {
211
199
super ( ) ;
212
200
@@ -392,14 +380,7 @@ export class AuthenticationService extends Disposable implements IAuthentication
392
380
: true ;
393
381
}
394
382
395
- const remoteConnection = this . remoteAgentService . getConnection ( ) ;
396
- // Right now, this is hardcoded to only happen in Codespaces and on web.
397
- // TODO: this should be determined by the embedder so that this logic isn't in core.
398
- const allowedAllowedExtensions = remoteConnection !== null
399
- ? remoteConnection . remoteAuthority . startsWith ( 'codespaces' )
400
- : isWeb ;
401
-
402
- if ( allowedAllowedExtensions && FIRST_PARTY_ALLOWED_EXTENSIONS . includes ( extensionId ) ) {
383
+ if ( this . productService . trustedExtensionAuthAccess ?. includes ( extensionId ) ) {
403
384
return true ;
404
385
}
405
386
0 commit comments