@@ -7,7 +7,6 @@ import { flatten } from 'vs/base/common/arrays';
77import { Emitter , Event } from 'vs/base/common/event' ;
88import { IJSONSchema } from 'vs/base/common/jsonSchema' ;
99import { Disposable , dispose , IDisposable , MutableDisposable } from 'vs/base/common/lifecycle' ;
10- import { isWeb } from 'vs/base/common/platform' ;
1110import { isFalsyOrWhitespace } from 'vs/base/common/strings' ;
1211import { isString } from 'vs/base/common/types' ;
1312import * as nls from 'vs/nls' ;
@@ -26,7 +25,6 @@ import { AuthenticationProviderInformation, AuthenticationSession, Authenticatio
2625import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService' ;
2726import { ActivationKind , IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
2827import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
29- import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
3028
3129export function getAuthenticationProviderActivationEvent ( id : string ) : string { return `onAuthenticationRequest:${ id } ` ; }
3230
@@ -36,16 +34,6 @@ interface IAccountUsage {
3634 lastUsed : number ;
3735}
3836
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-
4937export function readAccountUsages ( storageService : IStorageService , providerId : string , accountName : string , ) : IAccountUsage [ ] {
5038 const accountKey = `${ providerId } -${ accountName } -usages` ;
5139 const storedUsages = storageService . get ( accountKey , StorageScope . APPLICATION ) ;
@@ -204,9 +192,9 @@ export class AuthenticationService extends Disposable implements IAuthentication
204192 @IActivityService private readonly activityService : IActivityService ,
205193 @IExtensionService private readonly extensionService : IExtensionService ,
206194 @IStorageService private readonly storageService : IStorageService ,
207- @IRemoteAgentService private readonly remoteAgentService : IRemoteAgentService ,
208195 @IDialogService private readonly dialogService : IDialogService ,
209- @IQuickInputService private readonly quickInputService : IQuickInputService
196+ @IQuickInputService private readonly quickInputService : IQuickInputService ,
197+ @IProductService private readonly productService : IProductService ,
210198 ) {
211199 super ( ) ;
212200
@@ -392,14 +380,7 @@ export class AuthenticationService extends Disposable implements IAuthentication
392380 : true ;
393381 }
394382
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 ) ) {
403384 return true ;
404385 }
405386
0 commit comments