Remove deprecated auth API proposals. Fixes #127144

This commit is contained in:
Tyler Leonhardt
2021-07-08 10:38:10 -07:00
parent a28d028d2d
commit ba01bbac9c
6 changed files with 0 additions and 89 deletions

View File

@@ -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 => {

View File

@@ -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<vscode.AuthenticationProvidersChangeEvent> {
checkProposedApiEnabled(extension);
return extHostAuthentication.onDidChangeAuthenticationProviders;
},
get providers(): ReadonlyArray<vscode.AuthenticationProviderInformation> {
checkProposedApiEnabled(extension);
return extHostAuthentication.providers;
},
logout(providerId: string, sessionId: string): Thenable<void> {
checkProposedApiEnabled(extension);
return extHostAuthentication.removeSession(providerId, sessionId);
}
};

View File

@@ -1281,7 +1281,6 @@ export interface ExtHostAuthenticationShape {
$createSession(id: string, scopes: string[]): Promise<modes.AuthenticationSession>;
$removeSession(id: string, sessionId: string): Promise<void>;
$onDidChangeAuthenticationSessions(id: string, label: string): Promise<void>;
$onDidChangeAuthenticationProviders(added: modes.AuthenticationProviderInformation[], removed: modes.AuthenticationProviderInformation[]): Promise<void>;
$setProviders(providers: modes.AuthenticationProviderInformation[]): Promise<void>;
}

View File

@@ -27,9 +27,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
private _providers: vscode.AuthenticationProviderInformation[] = [];
private _onDidChangeAuthenticationProviders = new Emitter<vscode.AuthenticationProvidersChangeEvent>();
readonly onDidChangeAuthenticationProviders: Event<vscode.AuthenticationProvidersChangeEvent> = this._onDidChangeAuthenticationProviders.event;
private _onDidChangeSessions = new Emitter<vscode.AuthenticationSessionsChangeEvent>();
readonly onDidChangeSessions: Event<vscode.AuthenticationSessionsChangeEvent> = this._onDidChangeSessions.event;
@@ -44,10 +41,6 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
return Promise.resolve();
}
get providers(): ReadonlyArray<vscode.AuthenticationProviderInformation> {
return Object.freeze(this._providers.slice());
}
async getSession(requestingExtension: IExtensionDescription, providerId: string, scopes: readonly string[], options: vscode.AuthenticationGetSessionOptions & { createIfNone: true }): Promise<vscode.AuthenticationSession>;
async getSession(requestingExtension: IExtensionDescription, providerId: string, scopes: readonly string[], options: vscode.AuthenticationGetSessionOptions = {}): Promise<vscode.AuthenticationSession | undefined> {
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();
}
}