Merge from vscode 0a7364f00514c46c9caceece15e1f82f82e3712f

This commit is contained in:
ADS Merger
2020-07-22 03:06:57 +00:00
parent 53ec7585a9
commit 1b7b54ce14
229 changed files with 5099 additions and 3188 deletions

View File

@@ -37,26 +37,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
}
get providers(): ReadonlyArray<vscode.AuthenticationProviderInformation> {
return Object.freeze(this._providers);
}
private async resolveSessions(providerId: string): Promise<ReadonlyArray<modes.AuthenticationSession>> {
const provider = this._authenticationProviders.get(providerId);
let sessions;
if (!provider) {
sessions = await this._proxy.$getSessions(providerId);
} else {
sessions = await provider.getSessions();
}
return sessions;
}
async hasSessions(providerId: string, scopes: string[]): Promise<boolean> {
const orderedScopes = scopes.sort().join(' ');
const sessions = await this.resolveSessions(providerId);
return !!(sessions.filter(session => session.scopes.slice().sort().join(' ') === orderedScopes).length);
return Object.freeze(this._providers.slice());
}
async getSession(requestingExtension: IExtensionDescription, providerId: string, scopes: string[], options: vscode.AuthenticationGetSessionOptions & { createIfNone: true }): Promise<vscode.AuthenticationSession>;
@@ -94,7 +75,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
}
const session = await provider.login(scopes);
await this._proxy.$setTrustedExtension(providerId, session.account.label, extensionId, extensionName);
await this._proxy.$setTrustedExtensionAndAccountPreference(providerId, session.account.label, extensionId, extensionName, session.id);
return session;
} else {
await this._proxy.$requestNewSession(providerId, scopes, extensionId, extensionName);