diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 0168ece55df..6ebd6b36556 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -16,48 +16,6 @@ declare module 'vscode' { - //#region auth provider: https://github.com/microsoft/vscode/issues/88309 - - /** - * An {@link Event} which fires when an {@link AuthenticationProvider} is added or removed. - */ - export interface AuthenticationProvidersChangeEvent { - /** - * The ids of the {@link AuthenticationProvider}s that have been added. - */ - readonly added: ReadonlyArray; - - /** - * The ids of the {@link AuthenticationProvider}s that have been removed. - */ - readonly removed: ReadonlyArray; - } - - export namespace authentication { - /** - * @deprecated - getSession should now trigger extension activation. - * Fires with the provider id that was registered or unregistered. - */ - export const onDidChangeAuthenticationProviders: Event; - - /** - * @deprecated - * An array of the information of authentication providers that are currently registered. - */ - export const providers: ReadonlyArray; - - /** - * @deprecated - * Logout of a specific session. - * @param providerId The id of the provider to use - * @param sessionId The session id to remove - * provider - */ - export function logout(providerId: string, sessionId: string): Thenable; - } - - //#endregion - // eslint-disable-next-line vscode-dts-region-comments //#region @alexdima - resolvers diff --git a/src/vs/workbench/api/browser/mainThreadAuthentication.ts b/src/vs/workbench/api/browser/mainThreadAuthentication.ts index c54c35799ef..824aa63c881 100644 --- a/src/vs/workbench/api/browser/mainThreadAuthentication.ts +++ b/src/vs/workbench/api/browser/mainThreadAuthentication.ts @@ -152,14 +152,6 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu this._proxy.$onDidChangeAuthenticationSessions(e.providerId, e.label); })); - this._register(this.authenticationService.onDidRegisterAuthenticationProvider(info => { - this._proxy.$onDidChangeAuthenticationProviders([info], []); - })); - - this._register(this.authenticationService.onDidUnregisterAuthenticationProvider(info => { - this._proxy.$onDidChangeAuthenticationProviders([], [info]); - })); - this._proxy.$setProviders(this.authenticationService.declaredProviders); this._register(this.authenticationService.onDidChangeDeclaredProviders(e => { diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 22080ab47fc..dd7808fb806 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -233,18 +233,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }, registerAuthenticationProvider(id: string, label: string, provider: vscode.AuthenticationProvider, options?: vscode.AuthenticationProviderOptions): vscode.Disposable { return extHostAuthentication.registerAuthenticationProvider(id, label, provider, options); - }, - get onDidChangeAuthenticationProviders(): Event { - checkProposedApiEnabled(extension); - return extHostAuthentication.onDidChangeAuthenticationProviders; - }, - get providers(): ReadonlyArray { - checkProposedApiEnabled(extension); - return extHostAuthentication.providers; - }, - logout(providerId: string, sessionId: string): Thenable { - checkProposedApiEnabled(extension); - return extHostAuthentication.removeSession(providerId, sessionId); } }; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index cdee29bf300..742227bf7a2 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1281,7 +1281,6 @@ export interface ExtHostAuthenticationShape { $createSession(id: string, scopes: string[]): Promise; $removeSession(id: string, sessionId: string): Promise; $onDidChangeAuthenticationSessions(id: string, label: string): Promise; - $onDidChangeAuthenticationProviders(added: modes.AuthenticationProviderInformation[], removed: modes.AuthenticationProviderInformation[]): Promise; $setProviders(providers: modes.AuthenticationProviderInformation[]): Promise; } diff --git a/src/vs/workbench/api/common/extHostAuthentication.ts b/src/vs/workbench/api/common/extHostAuthentication.ts index c134a357403..97cd1fb2689 100644 --- a/src/vs/workbench/api/common/extHostAuthentication.ts +++ b/src/vs/workbench/api/common/extHostAuthentication.ts @@ -27,9 +27,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { private _providers: vscode.AuthenticationProviderInformation[] = []; - private _onDidChangeAuthenticationProviders = new Emitter(); - readonly onDidChangeAuthenticationProviders: Event = this._onDidChangeAuthenticationProviders.event; - private _onDidChangeSessions = new Emitter(); readonly onDidChangeSessions: Event = this._onDidChangeSessions.event; @@ -44,10 +41,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { return Promise.resolve(); } - get providers(): ReadonlyArray { - return Object.freeze(this._providers.slice()); - } - async getSession(requestingExtension: IExtensionDescription, providerId: string, scopes: readonly string[], options: vscode.AuthenticationGetSessionOptions & { createIfNone: true }): Promise; async getSession(requestingExtension: IExtensionDescription, providerId: string, scopes: readonly string[], options: vscode.AuthenticationGetSessionOptions = {}): Promise { const extensionId = ExtensionIdentifier.toKey(requestingExtension.identifier); @@ -164,22 +157,4 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape { this._onDidChangeSessions.fire({ provider: { id, label } }); return Promise.resolve(); } - - $onDidChangeAuthenticationProviders(added: modes.AuthenticationProviderInformation[], removed: modes.AuthenticationProviderInformation[]) { - added.forEach(provider => { - if (!this._providers.some(p => p.id === provider.id)) { - this._providers.push(provider); - } - }); - - removed.forEach(p => { - const index = this._providers.findIndex(provider => provider.id === p.id); - if (index > -1) { - this._providers.splice(index); - } - }); - - this._onDidChangeAuthenticationProviders.fire({ added, removed }); - return Promise.resolve(); - } } diff --git a/src/vs/workbench/test/browser/api/mainThreadAuthentication.test.ts b/src/vs/workbench/test/browser/api/mainThreadAuthentication.test.ts index 92a924aed86..3a2b733ada0 100644 --- a/src/vs/workbench/test/browser/api/mainThreadAuthentication.test.ts +++ b/src/vs/workbench/test/browser/api/mainThreadAuthentication.test.ts @@ -103,7 +103,6 @@ suite('MainThreadAuthentication', () => { }, $removeSession(id: string, sessionId: string) { return Promise.resolve(); }, $onDidChangeAuthenticationSessions(id: string, label: string) { return Promise.resolve(); }, - $onDidChangeAuthenticationProviders(added: AuthenticationProviderInformation[], removed: AuthenticationProviderInformation[]) { return Promise.resolve(); }, $setProviders(providers: AuthenticationProviderInformation[]) { return Promise.resolve(); } }; }