Skip to content

Commit cb0f0ef

Browse files
committed
Remember when ticket was requested (microsoft#187456)
1 parent e87dc37 commit cb0f0ef

File tree

5 files changed

+27
-32
lines changed

5 files changed

+27
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@parcel/watcher": "2.1.0",
7171
"@vscode/iconv-lite-umd": "0.7.0",
7272
"@vscode/policy-watcher": "^1.1.4",
73-
"@vscode/proxy-agent": "^0.17.0",
73+
"@vscode/proxy-agent": "^0.17.1",
7474
"@vscode/ripgrep": "^1.15.5",
7575
"@vscode/spdlog": "^0.13.10",
7676
"@vscode/sqlite3": "5.1.6-vscode",

remote/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@microsoft/1ds-post-js": "^3.2.2",
88
"@parcel/watcher": "2.1.0",
99
"@vscode/iconv-lite-umd": "0.7.0",
10-
"@vscode/proxy-agent": "^0.17.0",
10+
"@vscode/proxy-agent": "^0.17.1",
1111
"@vscode/ripgrep": "^1.15.5",
1212
"@vscode/spdlog": "^0.13.10",
1313
"@vscode/vscode-languagedetection": "1.0.21",

remote/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@
5858
resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48"
5959
integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==
6060

61-
"@vscode/proxy-agent@^0.17.0":
62-
version "0.17.0"
63-
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.0.tgz#e60d43e2779c07c223d3bad9b7de8eedf7ca1294"
64-
integrity sha512-p4gJ57KeWGw0CEG9R13dmsgmWmszoOQ836pf/PVbAf+ZRF27il3QcFvOhA10XE2QFHaOcRxuJnnIpUD1lSMvqQ==
61+
"@vscode/proxy-agent@^0.17.1":
62+
version "0.17.1"
63+
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.1.tgz#00ea42fb3565c78c38bc99a73d4460db538aef4e"
64+
integrity sha512-KWQ5y2uB6547Oudx2TMV28PdcdqNzI4J7TZzhZht1kNra8spqOzQJXw6gBdoh2mMFVpNiKgVhZ9YinWR0BZHiw==
6565
dependencies:
6666
"@tootallnate/once" "^3.0.0"
6767
agent-base "^7.0.1"

src/vs/workbench/api/node/proxyResolver.ts

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function connectProxyResolver(
3232
const doUseHostProxy = typeof useHostProxy === 'boolean' ? useHostProxy : !initData.remote.isRemote;
3333
const params: ProxyAgentParams = {
3434
resolveProxy: url => extHostWorkspace.resolveProxy(url),
35-
lookupProxyAuthorization: lookupProxyAuthorization.bind(undefined, extHostLogService, configProvider, {}, {}),
35+
lookupProxyAuthorization: lookupProxyAuthorization.bind(undefined, extHostLogService, configProvider, {}),
3636
getProxyURL: () => configProvider.getConfiguration('http').get('proxy'),
3737
getProxySupport: () => configProvider.getConfiguration('http').get<ProxySupportSetting>('proxySupport') || 'off',
3838
getSystemCertificatesV1: () => certSettingV1(configProvider),
@@ -121,9 +121,9 @@ async function lookupProxyAuthorization(
121121
extHostLogService: ILogService,
122122
configProvider: ExtHostConfigProvider,
123123
proxyAuthenticateCache: Record<string, string | string[] | undefined>,
124-
pendingLookups: Record<string, Promise<string | undefined>>,
125124
proxyURL: string,
126-
proxyAuthenticate?: string | string[]
125+
proxyAuthenticate: string | string[] | undefined,
126+
state: { kerberosRequested?: boolean }
127127
): Promise<string | undefined> {
128128
const cached = proxyAuthenticateCache[proxyURL];
129129
if (proxyAuthenticate) {
@@ -132,25 +132,20 @@ async function lookupProxyAuthorization(
132132
extHostLogService.trace('ProxyResolver#lookupProxyAuthorization callback', `proxyURL:${proxyURL}`, `proxyAuthenticate:${proxyAuthenticate}`, `proxyAuthenticateCache:${cached}`);
133133
const header = proxyAuthenticate || cached;
134134
const authenticate = Array.isArray(header) ? header : typeof header === 'string' ? [header] : [];
135-
if (authenticate.some(a => /^(Negotiate|Kerberos)( |$)/i.test(a))) {
136-
const lookupKey = `${proxyURL}:Negotiate`;
137-
return pendingLookups[lookupKey] ??= (async () => {
138-
try {
139-
const kerberos = await import('kerberos');
140-
const url = new URL(proxyURL);
141-
const spn = configProvider.getConfiguration('http').get<string>('proxyKerberosServicePrincipal')
142-
|| (process.platform === 'win32' ? `HTTP/${url.hostname}` : `HTTP@${url.hostname}`);
143-
extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Kerberos authentication lookup', `proxyURL:${proxyURL}`, `spn:${spn}`);
144-
const client = await kerberos.initializeClient(spn);
145-
const response = await client.step('');
146-
return 'Negotiate ' + response;
147-
} catch (err) {
148-
extHostLogService.error('ProxyResolver#lookupProxyAuthorization Kerberos authentication failed', err);
149-
return undefined;
150-
} finally {
151-
delete pendingLookups[lookupKey];
152-
}
153-
})();
135+
if (authenticate.some(a => /^(Negotiate|Kerberos)( |$)/i.test(a)) && !state.kerberosRequested) {
136+
try {
137+
state.kerberosRequested = true;
138+
const kerberos = await import('kerberos');
139+
const url = new URL(proxyURL);
140+
const spn = configProvider.getConfiguration('http').get<string>('proxyKerberosServicePrincipal')
141+
|| (process.platform === 'win32' ? `HTTP/${url.hostname}` : `HTTP@${url.hostname}`);
142+
extHostLogService.debug('ProxyResolver#lookupProxyAuthorization Kerberos authentication lookup', `proxyURL:${proxyURL}`, `spn:${spn}`);
143+
const client = await kerberos.initializeClient(spn);
144+
const response = await client.step('');
145+
return 'Negotiate ' + response;
146+
} catch (err) {
147+
extHostLogService.error('ProxyResolver#lookupProxyAuthorization Kerberos authentication failed', err);
148+
}
154149
}
155150
return undefined;
156151
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,10 +1309,10 @@
13091309
bindings "^1.5.0"
13101310
node-addon-api "^6.0.0"
13111311

1312-
"@vscode/proxy-agent@^0.17.0":
1313-
version "0.17.0"
1314-
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.0.tgz#e60d43e2779c07c223d3bad9b7de8eedf7ca1294"
1315-
integrity sha512-p4gJ57KeWGw0CEG9R13dmsgmWmszoOQ836pf/PVbAf+ZRF27il3QcFvOhA10XE2QFHaOcRxuJnnIpUD1lSMvqQ==
1312+
"@vscode/proxy-agent@^0.17.1":
1313+
version "0.17.1"
1314+
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.17.1.tgz#00ea42fb3565c78c38bc99a73d4460db538aef4e"
1315+
integrity sha512-KWQ5y2uB6547Oudx2TMV28PdcdqNzI4J7TZzhZht1kNra8spqOzQJXw6gBdoh2mMFVpNiKgVhZ9YinWR0BZHiw==
13161316
dependencies:
13171317
"@tootallnate/once" "^3.0.0"
13181318
agent-base "^7.0.1"

0 commit comments

Comments
 (0)