Update to @vscode/proxy-agent 0.21.0

This commit is contained in:
Christof Marti 2024-06-24 14:11:39 +02:00
parent 1b883b238e
commit 3cdb165262
6 changed files with 19 additions and 19 deletions

View file

@ -8,7 +8,7 @@ import 'mocha';
import { assertNoRpc } from '../utils';
import { pki } from 'node-forge';
import { AddressInfo } from 'net';
import { resetCaches } from '@vscode/proxy-agent';
import { resetCaches, testCertificates } from '@vscode/proxy-agent';
suite('vscode API - network proxy support', () => {
@ -52,8 +52,8 @@ suite('vscode API - network proxy support', () => {
rejectPort(err);
});
// Using https.globalAgent because it is shared with proxyResolver.ts and mutable.
(https.globalAgent as any).testCertificates = [certPEM];
// Using `testCertificates` shared between proxyResolver.ts and proxy.test.ts.
testCertificates.splice(0, testCertificates.length, certPEM);
resetCaches();
try {
@ -69,7 +69,7 @@ suite('vscode API - network proxy support', () => {
.on('error', reject);
});
} finally {
delete (https.globalAgent as any).testCertificates;
testCertificates.splice(0, testCertificates.length);
resetCaches();
server.close();
}

View file

@ -73,7 +73,7 @@
"@vscode/deviceid": "^0.1.1",
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/policy-watcher": "^1.1.4",
"@vscode/proxy-agent": "^0.20.0",
"@vscode/proxy-agent": "^0.21.0",
"@vscode/ripgrep": "^1.15.9",
"@vscode/spdlog": "^0.15.0",
"@vscode/sqlite3": "5.1.6-vscode",
@ -229,4 +229,4 @@
"optionalDependencies": {
"windows-foreground-love": "0.5.0"
}
}
}

View file

@ -8,7 +8,7 @@
"@parcel/watcher": "2.1.0",
"@vscode/deviceid": "^0.1.1",
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/proxy-agent": "^0.20.0",
"@vscode/proxy-agent": "^0.21.0",
"@vscode/ripgrep": "^1.15.9",
"@vscode/spdlog": "^0.15.0",
"@vscode/vscode-languagedetection": "1.0.21",

View file

@ -66,10 +66,10 @@
resolved "https://registry.yarnpkg.com/@vscode/iconv-lite-umd/-/iconv-lite-umd-0.7.0.tgz#d2f1e0664ee6036408f9743fee264ea0699b0e48"
integrity sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==
"@vscode/proxy-agent@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.20.0.tgz#48cbfd15e76da674bb1ba6e09a05b736d5677df0"
integrity sha512-FskCQwrFiXI+KiGgvEvUENNDffu5cDg3Cz1zWsafqvuPoPpTC88SOJl9kbeu3Y2YvSMcHx/r3tkK6ICoMaEWNQ==
"@vscode/proxy-agent@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.21.0.tgz#93c818b863ad20b42679032ecc1e3ecdc6306f12"
integrity sha512-9YcpBq+ZhMr3EQY/5ScyHc9kIIU/AcYOQn3DXq0N9tl81ViVsUvii3Fh+FAtD0YQ/qWtDfGxt8VCWZtuyh2D0g==
dependencies:
"@tootallnate/once" "^3.0.0"
agent-base "^7.0.1"

View file

@ -16,7 +16,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionS
import { URI } from 'vs/base/common/uri';
import { ILogService, LogLevel as LogServiceLevel } from 'vs/platform/log/common/log';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { LogLevel, createHttpPatch, createProxyResolver, createTlsPatch, ProxySupportSetting, ProxyAgentParams, createNetPatch, loadSystemCertificates } from '@vscode/proxy-agent';
import { LogLevel, createHttpPatch, createProxyResolver, createTlsPatch, ProxySupportSetting, ProxyAgentParams, createNetPatch, loadSystemCertificates, testCertificates } from '@vscode/proxy-agent';
const systemCertificatesV2Default = false;
@ -67,10 +67,10 @@ export function connectProxyResolver(
certs.then(certs => extHostLogService.trace('ProxyResolver#loadAdditionalCertificates: Loaded certificates from main process', certs.length));
promises.push(certs);
}
// Using https.globalAgent because it is shared with proxy.test.ts and mutable.
if (initData.environment.extensionTestsLocationURI && (https.globalAgent as any).testCertificates?.length) {
// Using `testCertificates` shared between proxyResolver.ts and proxy.test.ts.
if (initData.environment.extensionTestsLocationURI && testCertificates.length) {
extHostLogService.trace('ProxyResolver#loadAdditionalCertificates: Loading test certificates');
promises.push(Promise.resolve((https.globalAgent as any).testCertificates as string[]));
promises.push(Promise.resolve(testCertificates));
}
return (await Promise.all(promises)).flat();
},

View file

@ -1570,10 +1570,10 @@
bindings "^1.5.0"
node-addon-api "^6.0.0"
"@vscode/proxy-agent@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.20.0.tgz#48cbfd15e76da674bb1ba6e09a05b736d5677df0"
integrity sha512-FskCQwrFiXI+KiGgvEvUENNDffu5cDg3Cz1zWsafqvuPoPpTC88SOJl9kbeu3Y2YvSMcHx/r3tkK6ICoMaEWNQ==
"@vscode/proxy-agent@^0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@vscode/proxy-agent/-/proxy-agent-0.21.0.tgz#93c818b863ad20b42679032ecc1e3ecdc6306f12"
integrity sha512-9YcpBq+ZhMr3EQY/5ScyHc9kIIU/AcYOQn3DXq0N9tl81ViVsUvii3Fh+FAtD0YQ/qWtDfGxt8VCWZtuyh2D0g==
dependencies:
"@tootallnate/once" "^3.0.0"
agent-base "^7.0.1"