Rename Session to AuthenticationSession

This commit is contained in:
Rachel Macfarlane
2020-02-03 09:59:59 -08:00
parent 05567322f7
commit c52bfa8906
7 changed files with 21 additions and 21 deletions

View File

@@ -28,7 +28,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi
return this._provider.displayName;
}
async getSessions(): Promise<ReadonlyArray<vscode.Session>> {
async getSessions(): Promise<ReadonlyArray<vscode.AuthenticationSession>> {
const isAllowed = await this._proxy.$getSessionsPrompt(this._provider.id, this.displayName, ExtensionIdentifier.toKey(this._requestingExtension.identifier), this._requestingExtension.displayName || this._requestingExtension.name);
if (!isAllowed) {
throw new Error('User did not consent to session access.');
@@ -37,7 +37,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi
return this._provider.getSessions();
}
async login(scopes: string[]): Promise<vscode.Session> {
async login(scopes: string[]): Promise<vscode.AuthenticationSession> {
const isAllowed = await this._proxy.$loginPrompt(this._provider.id, this.displayName, ExtensionIdentifier.toKey(this._requestingExtension.identifier), this._requestingExtension.displayName || this._requestingExtension.name);
if (!isAllowed) {
throw new Error('User did not consent to login.');
@@ -90,7 +90,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
});
}
$login(providerId: string, scopes: string[]): Promise<modes.Session> {
$login(providerId: string, scopes: string[]): Promise<modes.AuthenticationSession> {
const authProvider = this._authenticationProviders.get(providerId);
if (authProvider) {
return Promise.resolve(authProvider.login(scopes));
@@ -108,7 +108,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
throw new Error(`Unable to find authentication provider with handle: ${0}`);
}
$getSessions(providerId: string): Promise<ReadonlyArray<modes.Session>> {
$getSessions(providerId: string): Promise<ReadonlyArray<modes.AuthenticationSession>> {
const authProvider = this._authenticationProviders.get(providerId);
if (authProvider) {
return Promise.resolve(authProvider.getSessions());