fix: update patch with correct version

This commit is contained in:
Baptiste Augrain 2022-11-02 09:42:32 +01:00
parent 0f32071868
commit 06e0b79e29
2 changed files with 47 additions and 39 deletions

View file

@ -1,4 +1,4 @@
{ {
"tag": "1.73.0", "tag": "1.73.0",
"commit": "504c5a768a001b2099dd2b44e9dc39e10ccdfb56" "commit": "8fa188b2b301d36553cbc9ce1b0a146ccb93351f"
} }

View file

@ -1,22 +1,18 @@
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
index 94ce542..2e93aea 100644 index 830e698..cd6f27e 100644
--- a/extensions/github-authentication/src/githubServer.ts --- a/extensions/github-authentication/src/githubServer.ts
+++ b/extensions/github-authentication/src/githubServer.ts +++ b/extensions/github-authentication/src/githubServer.ts
@@ -5,7 +5,4 @@ @@ -7,4 +7,2 @@ import * as vscode from 'vscode';
-import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import fetch, { Response } from 'node-fetch'; import fetch, { Response } from 'node-fetch';
-import { v4 as uuid } from 'uuid'; -import { v4 as uuid } from 'uuid';
-import { PromiseAdapter, promiseFromEvent } from './common/utils'; -import { PromiseAdapter, promiseFromEvent } from './common/utils';
import { ExperimentationTelemetry } from './experimentationService'; import { ExperimentationTelemetry } from './experimentationService';
@@ -13,14 +10,5 @@ import { AuthProviderType } from './github'; @@ -12,13 +10,4 @@ import { AuthProviderType } from './github';
import { Log } from './common/logger'; import { Log } from './common/logger';
-import { isSupportedEnvironment } from './common/env'; -import { isSupportedEnvironment } from './common/env';
-import { LoopbackAuthServer } from './authServer'; -import { LoopbackAuthServer } from './authServer';
-import path = require('path'); -import path = require('path');
-
-const localize = nls.loadMessageBundle();
-const CLIENT_ID = '01ab8ac9400c4e429b23'; -const CLIENT_ID = '01ab8ac9400c4e429b23';
-const GITHUB_TOKEN_URL = 'https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token'; -const GITHUB_TOKEN_URL = 'https://vscode.dev/codeExchangeProxyEndpoints/github/login/oauth/access_token';
const NETWORK_ERROR = 'network error'; const NETWORK_ERROR = 'network error';
@ -25,7 +21,7 @@ index 94ce542..2e93aea 100644
-const REDIRECT_URL_INSIDERS = 'https://insiders.vscode.dev/redirect'; -const REDIRECT_URL_INSIDERS = 'https://insiders.vscode.dev/redirect';
- -
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler { class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
@@ -44,9 +32,2 @@ export interface IGitHubServer extends vscode.Disposable { @@ -42,9 +31,2 @@ export interface IGitHubServer extends vscode.Disposable {
-interface IGitHubDeviceCodeResponse { -interface IGitHubDeviceCodeResponse {
- device_code: string; - device_code: string;
@ -35,12 +31,12 @@ index 94ce542..2e93aea 100644
-} -}
- -
async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Promise<string[]> { async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Promise<string[]> {
@@ -57,3 +38,3 @@ async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Pro @@ -55,3 +37,3 @@ async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Pro
Authorization: `token ${token}`, Authorization: `token ${token}`,
- 'User-Agent': 'Visual-Studio-Code' - 'User-Agent': 'Visual-Studio-Code'
+ 'User-Agent': 'VSCodium' + 'User-Agent': 'VSCodium'
} }
@@ -77,7 +58,4 @@ export class GitHubServer implements IGitHubServer { @@ -75,7 +57,4 @@ export class GitHubServer implements IGitHubServer {
- private _pendingNonces = new Map<string, string[]>(); - private _pendingNonces = new Map<string, string[]>();
- private _codeExchangePromises = new Map<string, { promise: Promise<string>; cancel: vscode.EventEmitter<void> }>(); - private _codeExchangePromises = new Map<string, { promise: Promise<string>; cancel: vscode.EventEmitter<void> }>();
@ -48,11 +44,11 @@ index 94ce542..2e93aea 100644
private static _uriHandler: UriEventHandler | undefined; private static _uriHandler: UriEventHandler | undefined;
- private _redirectEndpoint: string | undefined; - private _redirectEndpoint: string | undefined;
@@ -85,2 +63,3 @@ export class GitHubServer implements IGitHubServer { @@ -83,2 +62,3 @@ export class GitHubServer implements IGitHubServer {
public readonly type: AuthProviderType, public readonly type: AuthProviderType,
+ // @ts-ignore + // @ts-ignore
private readonly _supportDeviceCodeFlow: boolean, private readonly _supportDeviceCodeFlow: boolean,
@@ -104,41 +83,2 @@ export class GitHubServer implements IGitHubServer { @@ -102,41 +82,2 @@ export class GitHubServer implements IGitHubServer {
- private async getRedirectEndpoint(): Promise<string> { - private async getRedirectEndpoint(): Promise<string> {
- if (this._redirectEndpoint) { - if (this._redirectEndpoint) {
@ -94,27 +90,27 @@ index 94ce542..2e93aea 100644
- } - }
- -
dispose() { dispose() {
@@ -158,58 +98,8 @@ export class GitHubServer implements IGitHubServer { @@ -156,58 +97,8 @@ export class GitHubServer implements IGitHubServer {
let userCancelled: boolean | undefined; let userCancelled: boolean | undefined;
- const yes = localize('yes', "Yes"); - const yes = vscode.l10n.t('Yes');
- const no = localize('no', "No"); - const no = vscode.l10n.t('No');
- const promptToContinue = async () => { - const promptToContinue = async () => {
- if (userCancelled === undefined) { - if (userCancelled === undefined) {
- // We haven't had a failure yet so wait to prompt - // We haven't had a failure yet so wait to prompt
- return; - return;
- } - }
- const message = userCancelled - const message = userCancelled
- ? localize('userCancelledMessage', "Having trouble logging in? Would you like to try a different way?") - ? vscode.l10n.t('Having trouble logging in? Would you like to try a different way?')
- : localize('otherReasonMessage', "You have not yet finished authorizing this extension to use GitHub. Would you like to keep trying?"); - : vscode.l10n.t('You have not yet finished authorizing this extension to use GitHub. Would you like to keep trying?');
- const result = await vscode.window.showWarningMessage(message, yes, no); - const result = await vscode.window.showWarningMessage(message, yes, no);
- if (result !== yes) { - if (result !== yes) {
- throw new Error('Cancelled'); - throw new Error('Cancelled');
- } - }
- }; - };
-
- const nonce = uuid(); - const nonce = uuid();
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate?nonce=${encodeURIComponent(nonce)}`)); - const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate?nonce=${encodeURIComponent(nonce)}`));
-
- const supported = isSupportedEnvironment(callbackUri); - const supported = isSupportedEnvironment(callbackUri);
- if (supported) { - if (supported) {
- try { - try {
@ -158,13 +154,17 @@ index 94ce542..2e93aea 100644
+ this._logger.error(e); + this._logger.error(e);
+ userCancelled = e.message ?? e === 'User Cancelled'; + userCancelled = e.message ?? e === 'User Cancelled';
} }
@@ -219,127 +109,2 @@ export class GitHubServer implements IGitHubServer { @@ -217,136 +108,2 @@ export class GitHubServer implements IGitHubServer {
- private async doLoginWithoutLocalServer(scopes: string, nonce: string, callbackUri: vscode.Uri): Promise<string> { - private async doLoginWithoutLocalServer(scopes: string, nonce: string, callbackUri: vscode.Uri): Promise<string> {
- this._logger.info(`Trying without local server... (${scopes})`); - this._logger.info(`Trying without local server... (${scopes})`);
- return await vscode.window.withProgress<string>({ - return await vscode.window.withProgress<string>({
- location: vscode.ProgressLocation.Notification, - location: vscode.ProgressLocation.Notification,
- title: localize('signingIn', 'Signing in to {0}...', this.baseUri.authority), - title: vscode.l10n.t({
- message: 'Signing in to {0}...',
- args: [this.baseUri.authority],
- comment: ['The {0} will be a url, e.g. github.com']
- }),
- cancellable: true - cancellable: true
- }, async (_, token) => { - }, async (_, token) => {
- const existingNonces = this._pendingNonces.get(scopes) || []; - const existingNonces = this._pendingNonces.get(scopes) || [];
@ -209,7 +209,11 @@ index 94ce542..2e93aea 100644
- this._logger.info(`Trying with local server... (${scopes})`); - this._logger.info(`Trying with local server... (${scopes})`);
- return await vscode.window.withProgress<string>({ - return await vscode.window.withProgress<string>({
- location: vscode.ProgressLocation.Notification, - location: vscode.ProgressLocation.Notification,
- title: localize('signingInAnotherWay', "Signing in to {0}...", this.baseUri.authority), - title: vscode.l10n.t({
- message: 'Signing in to {0}...',
- args: [this.baseUri.authority],
- comment: ['The {0} will be a url, e.g. github.com']
- }),
- cancellable: true - cancellable: true
- }, async (_, token) => { - }, async (_, token) => {
- const redirectUri = await this.getRedirectEndpoint(); - const redirectUri = await this.getRedirectEndpoint();
@ -266,15 +270,15 @@ index 94ce542..2e93aea 100644
- -
- const json = await result.json() as IGitHubDeviceCodeResponse; - const json = await result.json() as IGitHubDeviceCodeResponse;
- -
- - const button = vscode.l10n.t('Copy & Continue to GitHub');
- const modalResult = await vscode.window.showInformationMessage( - const modalResult = await vscode.window.showInformationMessage(
- localize('code.title', "Your Code: {0}", json.user_code), - vscode.l10n.t({ message: 'Your Code: {0}', args: [json.user_code], comment: ['The {0} will be a code, e.g. 123-456'] }),
- { - {
- modal: true, - modal: true,
- detail: localize('code.detail', "To finish authenticating, navigate to GitHub and paste in the above one-time code.") - detail: vscode.l10n.t('To finish authenticating, navigate to GitHub and paste in the above one-time code.')
- }, 'Copy & Continue to GitHub'); - }, button);
- -
- if (modalResult !== 'Copy & Continue to GitHub') { - if (modalResult !== button) {
- throw new Error('User Cancelled'); - throw new Error('User Cancelled');
- } - }
- -
@ -285,8 +289,9 @@ index 94ce542..2e93aea 100644
- -
- return await this.waitForDeviceCodeAccessToken(json); - return await this.waitForDeviceCodeAccessToken(json);
- } - }
-
@@ -368,121 +133,2 @@ export class GitHubServer implements IGitHubServer { private async doLoginWithPat(scopes: string): Promise<string> {
@@ -374,124 +131,2 @@ export class GitHubServer implements IGitHubServer {
- private async waitForDeviceCodeAccessToken( - private async waitForDeviceCodeAccessToken(
- json: IGitHubDeviceCodeResponse, - json: IGitHubDeviceCodeResponse,
@ -294,11 +299,14 @@ index 94ce542..2e93aea 100644
- return await vscode.window.withProgress<string>({ - return await vscode.window.withProgress<string>({
- location: vscode.ProgressLocation.Notification, - location: vscode.ProgressLocation.Notification,
- cancellable: true, - cancellable: true,
- title: localize( - title: vscode.l10n.t({
- 'progress', - message: 'Open [{0}]({0}) in a new tab and paste your one-time code: {1}',
- "Open [{0}]({0}) in a new tab and paste your one-time code: {1}", - args: [json.verification_uri, json.user_code],
- json.verification_uri, - comment: [
- json.user_code) - 'The [{0}]({0}) will be a url and the {1} will be a code, e.g. 123-456',
- '{Locked="[{0}]({0})"}'
- ]
- })
- }, async (_, token) => { - }, async (_, token) => {
- const refreshTokenUri = this.baseUri.with({ - const refreshTokenUri = this.baseUri.with({
- path: '/login/oauth/access_token', - path: '/login/oauth/access_token',
@ -409,7 +417,7 @@ index 94ce542..2e93aea 100644
- -
private getServerUri(path: string = '') { private getServerUri(path: string = '') {
diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
index 1f16d17..61d5ccf 100644 index ce2a3e8..2a5cf60 100644
--- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
+++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts
@@ -306,3 +306,3 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem { @@ -306,3 +306,3 @@ export class AccountsActivityActionViewItem extends MenuActivityActionViewItem {
@ -418,10 +426,10 @@ index 1f16d17..61d5ccf 100644
+ if (!menus.length) { + if (!menus.length) {
const noAccountsAvailableAction = disposables.add(new Action('noAccountsAvailable', localize('noAccounts', "You are not signed in to any accounts"), undefined, false)); const noAccountsAvailableAction = disposables.add(new Action('noAccountsAvailable', localize('noAccounts', "You are not signed in to any accounts"), undefined, false));
diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts diff --git a/src/vs/workbench/services/authentication/browser/authenticationService.ts b/src/vs/workbench/services/authentication/browser/authenticationService.ts
index 69cb0d2..920d6c6 100644 index d5e2b75..a996eb7 100644
--- a/src/vs/workbench/services/authentication/browser/authenticationService.ts --- a/src/vs/workbench/services/authentication/browser/authenticationService.ts
+++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts +++ b/src/vs/workbench/services/authentication/browser/authenticationService.ts
@@ -275,12 +275,2 @@ export class AuthenticationService extends Disposable implements IAuthentication @@ -279,12 +279,2 @@ export class AuthenticationService extends Disposable implements IAuthentication
} }
- -
- if (!this._authenticationProviders.size) { - if (!this._authenticationProviders.size) {