From f1398e36294e0adb9460ae09c17270587a2d1254 Mon Sep 17 00:00:00 2001 From: Renaud Subiger Date: Fri, 29 Nov 2024 19:32:01 +0100 Subject: [PATCH] Fix missing proxy to authenticate and to fetch version --- dist/index.js | 870 +++++++++++++++++++++++++++++++++++++--------- dist/licenses.txt | 50 +++ index.js | 9 +- package-lock.json | 53 ++- package.json | 3 +- 5 files changed, 815 insertions(+), 170 deletions(-) diff --git a/dist/index.js b/dist/index.js index f31e46b..27e5249 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 4839: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; const os = __importStar(__nccwpck_require__(2037)); -const utils_1 = __nccwpck_require__(8226); +const utils_1 = __nccwpck_require__(5278); /** * Commands * @@ -100,7 +100,7 @@ function escapeProperty(s) { /***/ }), -/***/ 4728: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -135,12 +135,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(4839); -const file_command_1 = __nccwpck_require__(7487); -const utils_1 = __nccwpck_require__(8226); +const command_1 = __nccwpck_require__(7351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(9217); +const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action */ @@ -425,17 +425,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(9125); +var summary_1 = __nccwpck_require__(1327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(9125); +var summary_2 = __nccwpck_require__(1327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(6361); +var path_utils_1 = __nccwpck_require__(2981); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -443,7 +443,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 7487: +/***/ 717: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -474,8 +474,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(7147)); const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(446); -const utils_1 = __nccwpck_require__(8226); +const uuid_1 = __nccwpck_require__(8974); +const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -508,7 +508,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 9217: +/***/ 8041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -524,9 +524,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(3878); -const auth_1 = __nccwpck_require__(1867); -const core_1 = __nccwpck_require__(4728); +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); +const core_1 = __nccwpck_require__(2186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -592,7 +592,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 6361: +/***/ 2981: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -657,7 +657,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 9125: +/***/ 1327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -947,7 +947,7 @@ exports.summary = _summary; /***/ }), -/***/ 8226: +/***/ 5278: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -994,7 +994,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 446: +/***/ 8974: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1058,29 +1058,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(7365)); +var _v = _interopRequireDefault(__nccwpck_require__(1595)); -var _v2 = _interopRequireDefault(__nccwpck_require__(9493)); +var _v2 = _interopRequireDefault(__nccwpck_require__(6993)); -var _v3 = _interopRequireDefault(__nccwpck_require__(7071)); +var _v3 = _interopRequireDefault(__nccwpck_require__(1472)); -var _v4 = _interopRequireDefault(__nccwpck_require__(5073)); +var _v4 = _interopRequireDefault(__nccwpck_require__(6217)); -var _nil = _interopRequireDefault(__nccwpck_require__(3464)); +var _nil = _interopRequireDefault(__nccwpck_require__(2381)); -var _version = _interopRequireDefault(__nccwpck_require__(9255)); +var _version = _interopRequireDefault(__nccwpck_require__(427)); -var _validate = _interopRequireDefault(__nccwpck_require__(1454)); +var _validate = _interopRequireDefault(__nccwpck_require__(2609)); -var _stringify = _interopRequireDefault(__nccwpck_require__(389)); +var _stringify = _interopRequireDefault(__nccwpck_require__(1458)); -var _parse = _interopRequireDefault(__nccwpck_require__(8438)); +var _parse = _interopRequireDefault(__nccwpck_require__(6385)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 3552: +/***/ 5842: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1110,7 +1110,7 @@ exports["default"] = _default; /***/ }), -/***/ 3464: +/***/ 2381: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1125,7 +1125,7 @@ exports["default"] = _default; /***/ }), -/***/ 8438: +/***/ 6385: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1136,7 +1136,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1454)); +var _validate = _interopRequireDefault(__nccwpck_require__(2609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1177,7 +1177,7 @@ exports["default"] = _default; /***/ }), -/***/ 9828: +/***/ 6230: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1192,7 +1192,7 @@ exports["default"] = _default; /***/ }), -/***/ 2675: +/***/ 9784: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1223,7 +1223,7 @@ function rng() { /***/ }), -/***/ 7266: +/***/ 8844: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1253,7 +1253,7 @@ exports["default"] = _default; /***/ }), -/***/ 389: +/***/ 1458: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1264,7 +1264,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1454)); +var _validate = _interopRequireDefault(__nccwpck_require__(2609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1299,7 +1299,7 @@ exports["default"] = _default; /***/ }), -/***/ 7365: +/***/ 1595: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1310,9 +1310,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(2675)); +var _rng = _interopRequireDefault(__nccwpck_require__(9784)); -var _stringify = _interopRequireDefault(__nccwpck_require__(389)); +var _stringify = _interopRequireDefault(__nccwpck_require__(1458)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1413,7 +1413,7 @@ exports["default"] = _default; /***/ }), -/***/ 9493: +/***/ 6993: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1424,9 +1424,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(7958)); +var _v = _interopRequireDefault(__nccwpck_require__(5920)); -var _md = _interopRequireDefault(__nccwpck_require__(3552)); +var _md = _interopRequireDefault(__nccwpck_require__(5842)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1436,7 +1436,7 @@ exports["default"] = _default; /***/ }), -/***/ 7958: +/***/ 5920: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1448,9 +1448,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(389)); +var _stringify = _interopRequireDefault(__nccwpck_require__(1458)); -var _parse = _interopRequireDefault(__nccwpck_require__(8438)); +var _parse = _interopRequireDefault(__nccwpck_require__(6385)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1521,7 +1521,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 7071: +/***/ 1472: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1532,9 +1532,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(2675)); +var _rng = _interopRequireDefault(__nccwpck_require__(9784)); -var _stringify = _interopRequireDefault(__nccwpck_require__(389)); +var _stringify = _interopRequireDefault(__nccwpck_require__(1458)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1565,7 +1565,7 @@ exports["default"] = _default; /***/ }), -/***/ 5073: +/***/ 6217: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1576,9 +1576,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(7958)); +var _v = _interopRequireDefault(__nccwpck_require__(5920)); -var _sha = _interopRequireDefault(__nccwpck_require__(7266)); +var _sha = _interopRequireDefault(__nccwpck_require__(8844)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1588,7 +1588,7 @@ exports["default"] = _default; /***/ }), -/***/ 1454: +/***/ 2609: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1599,7 +1599,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(9828)); +var _regex = _interopRequireDefault(__nccwpck_require__(6230)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1612,7 +1612,7 @@ exports["default"] = _default; /***/ }), -/***/ 9255: +/***/ 427: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -1623,7 +1623,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(1454)); +var _validate = _interopRequireDefault(__nccwpck_require__(2609)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -1640,7 +1640,7 @@ exports["default"] = _default; /***/ }), -/***/ 5820: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1676,7 +1676,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; const string_decoder_1 = __nccwpck_require__(1576); -const tr = __importStar(__nccwpck_require__(8580)); +const tr = __importStar(__nccwpck_require__(8159)); /** * Exec a command. * Output will be streamed to the live console. @@ -1750,7 +1750,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 8580: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1789,8 +1789,8 @@ const os = __importStar(__nccwpck_require__(2037)); const events = __importStar(__nccwpck_require__(2361)); const child = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const io = __importStar(__nccwpck_require__(1255)); -const ioUtil = __importStar(__nccwpck_require__(3058)); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; @@ -2375,7 +2375,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 1867: +/***/ 5526: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2463,7 +2463,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 3878: +/***/ 6255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2501,8 +2501,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(3685)); const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(6501)); -const tunnel = __importStar(__nccwpck_require__(4592)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -3075,7 +3075,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 6501: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -3143,7 +3143,7 @@ exports.checkBypass = checkBypass; /***/ }), -/***/ 3058: +/***/ 1962: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3327,7 +3327,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 1255: +/***/ 7436: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3366,7 +3366,7 @@ const assert_1 = __nccwpck_require__(9491); const childProcess = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); const util_1 = __nccwpck_require__(3837); -const ioUtil = __importStar(__nccwpck_require__(3058)); +const ioUtil = __importStar(__nccwpck_require__(1962)); const exec = util_1.promisify(childProcess.exec); const execFile = util_1.promisify(childProcess.execFile); /** @@ -3675,7 +3675,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 1937: +/***/ 2473: /***/ (function(module, exports, __nccwpck_require__) { "use strict"; @@ -3710,8 +3710,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; -const semver = __importStar(__nccwpck_require__(8509)); -const core_1 = __nccwpck_require__(4728); +const semver = __importStar(__nccwpck_require__(5911)); +const core_1 = __nccwpck_require__(2186); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ const os = __nccwpck_require__(2037); @@ -3810,7 +3810,7 @@ exports._readLinuxVersionFile = _readLinuxVersionFile; /***/ }), -/***/ 4158: +/***/ 8279: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3845,7 +3845,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RetryHelper = void 0; -const core = __importStar(__nccwpck_require__(4728)); +const core = __importStar(__nccwpck_require__(2186)); /** * Internal class for retries */ @@ -3900,7 +3900,7 @@ exports.RetryHelper = RetryHelper; /***/ }), -/***/ 2234: +/***/ 7784: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3938,20 +3938,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0; -const core = __importStar(__nccwpck_require__(4728)); -const io = __importStar(__nccwpck_require__(1255)); +const core = __importStar(__nccwpck_require__(2186)); +const io = __importStar(__nccwpck_require__(7436)); const fs = __importStar(__nccwpck_require__(7147)); -const mm = __importStar(__nccwpck_require__(1937)); +const mm = __importStar(__nccwpck_require__(2473)); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const httpm = __importStar(__nccwpck_require__(3878)); -const semver = __importStar(__nccwpck_require__(8509)); +const httpm = __importStar(__nccwpck_require__(6255)); +const semver = __importStar(__nccwpck_require__(5911)); const stream = __importStar(__nccwpck_require__(2781)); const util = __importStar(__nccwpck_require__(3837)); const assert_1 = __nccwpck_require__(9491); -const v4_1 = __importDefault(__nccwpck_require__(3717)); -const exec_1 = __nccwpck_require__(5820); -const retry_helper_1 = __nccwpck_require__(4158); +const v4_1 = __importDefault(__nccwpck_require__(824)); +const exec_1 = __nccwpck_require__(1514); +const retry_helper_1 = __nccwpck_require__(8279); class HTTPError extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); @@ -4572,20 +4572,275 @@ function _unique(values) { /***/ }), -/***/ 516: +/***/ 8348: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.req = exports.json = exports.toBuffer = void 0; +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); +} +exports.toBuffer = toBuffer; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function json(stream) { + const buf = await toBuffer(stream); + const str = buf.toString('utf8'); + try { + return JSON.parse(str); + } + catch (_err) { + const err = _err; + err.message += ` (input: ${str})`; + throw err; + } +} +exports.json = json; +function req(url, opts = {}) { + const href = typeof url === 'string' ? url : url.href; + const req = (href.startsWith('https:') ? https : http).request(url, opts); + const promise = new Promise((resolve, reject) => { + req + .once('response', resolve) + .once('error', reject) + .end(); + }); + req.then = promise.then.bind(promise); + return req; +} +exports.req = req; +//# sourceMappingURL=helpers.js.map + +/***/ }), + +/***/ 694: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Agent = void 0; +const net = __importStar(__nccwpck_require__(1808)); +const http = __importStar(__nccwpck_require__(3685)); +const https_1 = __nccwpck_require__(5687); +__exportStar(__nccwpck_require__(8348), exports); +const INTERNAL = Symbol('AgentBaseInternalState'); +class Agent extends http.Agent { + constructor(opts) { + super(opts); + this[INTERNAL] = {}; + } + /** + * Determine whether this is an `http` or `https` request. + */ + isSecureEndpoint(options) { + if (options) { + // First check the `secureEndpoint` property explicitly, since this + // means that a parent `Agent` is "passing through" to this instance. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (typeof options.secureEndpoint === 'boolean') { + return options.secureEndpoint; + } + // If no explicit `secure` endpoint, check if `protocol` property is + // set. This will usually be the case since using a full string URL + // or `URL` instance should be the most common usage. + if (typeof options.protocol === 'string') { + return options.protocol === 'https:'; + } + } + // Finally, if no `protocol` property was set, then fall back to + // checking the stack trace of the current call stack, and try to + // detect the "https" module. + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack + .split('\n') + .some((l) => l.indexOf('(https.js:') !== -1 || + l.indexOf('node:https:') !== -1); + } + // In order to support async signatures in `connect()` and Node's native + // connection pooling in `http.Agent`, the array of sockets for each origin + // has to be updated synchronously. This is so the length of the array is + // accurate when `addRequest()` is next called. We achieve this by creating a + // fake socket and adding it to `sockets[origin]` and incrementing + // `totalSocketCount`. + incrementSockets(name) { + // If `maxSockets` and `maxTotalSockets` are both Infinity then there is no + // need to create a fake socket because Node.js native connection pooling + // will never be invoked. + if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { + return null; + } + // All instances of `sockets` are expected TypeScript errors. The + // alternative is to add it as a private property of this class but that + // will break TypeScript subclassing. + if (!this.sockets[name]) { + // @ts-expect-error `sockets` is readonly in `@types/node` + this.sockets[name] = []; + } + const fakeSocket = new net.Socket({ writable: false }); + this.sockets[name].push(fakeSocket); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount++; + return fakeSocket; + } + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { + return; + } + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount--; + if (sockets.length === 0) { + // @ts-expect-error `sockets` is readonly in `@types/node` + delete this.sockets[name]; + } + } + } + // In order to properly update the socket pool, we need to call `getName()` on + // the core `https.Agent` if it is a secureEndpoint. + getName(options) { + const secureEndpoint = typeof options.secureEndpoint === 'boolean' + ? options.secureEndpoint + : this.isSecureEndpoint(options); + if (secureEndpoint) { + // @ts-expect-error `getName()` isn't defined in `@types/node` + return https_1.Agent.prototype.getName.call(this, options); + } + // @ts-expect-error `getName()` isn't defined in `@types/node` + return super.getName(options); + } + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options), + }; + const name = this.getName(connectOpts); + const fakeSocket = this.incrementSockets(name); + Promise.resolve() + .then(() => this.connect(req, connectOpts)) + .then((socket) => { + this.decrementSockets(name, fakeSocket); + if (socket instanceof http.Agent) { + // @ts-expect-error `addRequest()` isn't defined in `@types/node` + return socket.addRequest(req, connectOpts); + } + this[INTERNAL].currentSocket = socket; + // @ts-expect-error `createSocket()` isn't defined in `@types/node` + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); + } + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = undefined; + if (!socket) { + throw new Error('No socket was returned in the `connect()` function'); + } + return socket; + } + get defaultPort() { + return (this[INTERNAL].defaultPort ?? + (this.protocol === 'https:' ? 443 : 80)); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; + } + } + get protocol() { + return (this[INTERNAL].protocol ?? + (this.isSecureEndpoint() ? 'https:' : 'http:')); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; + } + } +} +exports.Agent = Agent; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 4812: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = { - parallel : __nccwpck_require__(2790), - serial : __nccwpck_require__(7461), - serialOrdered : __nccwpck_require__(4581) + parallel : __nccwpck_require__(8210), + serial : __nccwpck_require__(445), + serialOrdered : __nccwpck_require__(3578) }; /***/ }), -/***/ 7537: +/***/ 1700: /***/ ((module) => { // API @@ -4621,10 +4876,10 @@ function clean(key) /***/ }), -/***/ 8832: +/***/ 2794: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var defer = __nccwpck_require__(691); +var defer = __nccwpck_require__(5295); // API module.exports = async; @@ -4662,7 +4917,7 @@ function async(callback) /***/ }), -/***/ 691: +/***/ 5295: /***/ ((module) => { module.exports = defer; @@ -4695,11 +4950,11 @@ function defer(fn) /***/ }), -/***/ 6681: +/***/ 9023: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var async = __nccwpck_require__(8832) - , abort = __nccwpck_require__(7537) +var async = __nccwpck_require__(2794) + , abort = __nccwpck_require__(1700) ; // API @@ -4777,7 +5032,7 @@ function runJob(iterator, key, item, callback) /***/ }), -/***/ 8381: +/***/ 2474: /***/ ((module) => { // API @@ -4821,11 +5076,11 @@ function state(list, sortMethod) /***/ }), -/***/ 6338: +/***/ 7942: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var abort = __nccwpck_require__(7537) - , async = __nccwpck_require__(8832) +var abort = __nccwpck_require__(1700) + , async = __nccwpck_require__(2794) ; // API @@ -4857,12 +5112,12 @@ function terminator(callback) /***/ }), -/***/ 2790: +/***/ 8210: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var iterate = __nccwpck_require__(6681) - , initState = __nccwpck_require__(8381) - , terminator = __nccwpck_require__(6338) +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(2474) + , terminator = __nccwpck_require__(7942) ; // Public API @@ -4907,10 +5162,10 @@ function parallel(list, iterator, callback) /***/ }), -/***/ 7461: +/***/ 445: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var serialOrdered = __nccwpck_require__(4581); +var serialOrdered = __nccwpck_require__(3578); // Public API module.exports = serial; @@ -4931,12 +5186,12 @@ function serial(list, iterator, callback) /***/ }), -/***/ 4581: +/***/ 3578: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var iterate = __nccwpck_require__(6681) - , initState = __nccwpck_require__(8381) - , terminator = __nccwpck_require__(6338) +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(2474) + , terminator = __nccwpck_require__(7942) ; // Public API @@ -5013,12 +5268,12 @@ function descending(a, b) /***/ }), -/***/ 5284: +/***/ 5443: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var util = __nccwpck_require__(3837); var Stream = (__nccwpck_require__(2781).Stream); -var DelayedStream = __nccwpck_require__(879); +var DelayedStream = __nccwpck_require__(8611); module.exports = CombinedStream; function CombinedStream() { @@ -5228,7 +5483,7 @@ CombinedStream.prototype._emitError = function(err) { /***/ }), -/***/ 6324: +/***/ 8222: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-env browser */ @@ -5485,7 +5740,7 @@ function localstorage() { } } -module.exports = __nccwpck_require__(7247)(exports); +module.exports = __nccwpck_require__(6243)(exports); const {formatters} = module.exports; @@ -5504,7 +5759,7 @@ formatters.j = function (v) { /***/ }), -/***/ 7247: +/***/ 6243: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -5520,7 +5775,7 @@ function setup(env) { createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(3403); + createDebug.humanize = __nccwpck_require__(900); createDebug.destroy = destroy; Object.keys(env).forEach(key => { @@ -5785,7 +6040,7 @@ module.exports = setup; /***/ }), -/***/ 6967: +/***/ 8237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** @@ -5794,15 +6049,15 @@ module.exports = setup; */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(6324); + module.exports = __nccwpck_require__(8222); } else { - module.exports = __nccwpck_require__(3349); + module.exports = __nccwpck_require__(5332); } /***/ }), -/***/ 3349: +/***/ 5332: /***/ ((module, exports, __nccwpck_require__) => { /** @@ -5836,7 +6091,7 @@ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(1964); + const supportsColor = __nccwpck_require__(9318); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ @@ -6044,7 +6299,7 @@ function init(debug) { } } -module.exports = __nccwpck_require__(7247)(exports); +module.exports = __nccwpck_require__(6243)(exports); const {formatters} = module.exports; @@ -6072,7 +6327,7 @@ formatters.O = function (v) { /***/ }), -/***/ 879: +/***/ 8611: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var Stream = (__nccwpck_require__(2781).Stream); @@ -6186,7 +6441,7 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { /***/ }), -/***/ 7203: +/***/ 1133: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var debug; @@ -6195,7 +6450,7 @@ module.exports = function () { if (!debug) { try { /* eslint global-require: off */ - debug = __nccwpck_require__(6967)("follow-redirects"); + debug = __nccwpck_require__(8237)("follow-redirects"); } catch (error) { /* */ } if (typeof debug !== "function") { @@ -6208,7 +6463,7 @@ module.exports = function () { /***/ }), -/***/ 6820: +/***/ 7707: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var url = __nccwpck_require__(7310); @@ -6217,7 +6472,7 @@ var http = __nccwpck_require__(3685); var https = __nccwpck_require__(5687); var Writable = (__nccwpck_require__(2781).Writable); var assert = __nccwpck_require__(9491); -var debug = __nccwpck_require__(7203); +var debug = __nccwpck_require__(1133); // Create handlers that pass events from native requests var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; @@ -6836,10 +7091,10 @@ module.exports.wrap = wrap; /***/ }), -/***/ 5114: +/***/ 4334: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var CombinedStream = __nccwpck_require__(5284); +var CombinedStream = __nccwpck_require__(5443); var util = __nccwpck_require__(3837); var path = __nccwpck_require__(1017); var http = __nccwpck_require__(3685); @@ -6847,9 +7102,9 @@ var https = __nccwpck_require__(5687); var parseUrl = (__nccwpck_require__(7310).parse); var fs = __nccwpck_require__(7147); var Stream = (__nccwpck_require__(2781).Stream); -var mime = __nccwpck_require__(2063); -var asynckit = __nccwpck_require__(516); -var populate = __nccwpck_require__(5193); +var mime = __nccwpck_require__(3583); +var asynckit = __nccwpck_require__(4812); +var populate = __nccwpck_require__(7142); // Public API module.exports = FormData; @@ -7344,7 +7599,7 @@ FormData.prototype.toString = function () { /***/ }), -/***/ 5193: +/***/ 7142: /***/ ((module) => { // populates missing values @@ -7361,7 +7616,7 @@ module.exports = function(dst, src) { /***/ }), -/***/ 4806: +/***/ 1621: /***/ ((module) => { "use strict"; @@ -7377,7 +7632,297 @@ module.exports = (flag, argv = process.argv) => { /***/ }), -/***/ 4852: +/***/ 7219: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpsProxyAgent = void 0; +const net = __importStar(__nccwpck_require__(1808)); +const tls = __importStar(__nccwpck_require__(4404)); +const assert_1 = __importDefault(__nccwpck_require__(9491)); +const debug_1 = __importDefault(__nccwpck_require__(8237)); +const agent_base_1 = __nccwpck_require__(694); +const url_1 = __nccwpck_require__(7310); +const parse_proxy_response_1 = __nccwpck_require__(595); +const debug = (0, debug_1.default)('https-proxy-agent'); +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + */ +class HttpsProxyAgent extends agent_base_1.Agent { + constructor(proxy, opts) { + super(opts); + this.options = { path: undefined }; + this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy; + this.proxyHeaders = opts?.headers ?? {}; + debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href); + // Trim off the brackets from IPv6 addresses + const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ''); + const port = this.proxy.port + ? parseInt(this.proxy.port, 10) + : this.proxy.protocol === 'https:' + ? 443 + : 80; + this.connectOpts = { + // Attempt to negotiate http/1.1 for proxy servers that support http/2 + ALPNProtocols: ['http/1.1'], + ...(opts ? omit(opts, 'headers') : null), + host, + port, + }; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + */ + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); + } + // Create a socket connection to the proxy server. + let socket; + if (proxy.protocol === 'https:') { + debug('Creating `tls.Socket`: %o', this.connectOpts); + const servername = this.connectOpts.servername || this.connectOpts.host; + socket = tls.connect({ + ...this.connectOpts, + servername, + }); + } + else { + debug('Creating `net.Socket`: %o', this.connectOpts); + socket = net.connect(this.connectOpts); + } + const headers = typeof this.proxyHeaders === 'function' + ? this.proxyHeaders() + : { ...this.proxyHeaders }; + const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; + let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; + } + headers.Host = `${host}:${opts.port}`; + if (!headers['Proxy-Connection']) { + headers['Proxy-Connection'] = this.keepAlive + ? 'Keep-Alive' + : 'close'; + } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket); + socket.write(`${payload}\r\n`); + const { connect, buffered } = await proxyResponsePromise; + req.emit('proxyConnect', connect); + this.emit('proxyConnect', connect, req); + if (connect.statusCode === 200) { + req.once('socket', resume); + if (opts.secureEndpoint) { + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + const servername = opts.servername || opts.host; + return tls.connect({ + ...omit(opts, 'host', 'path', 'port'), + socket, + servername, + }); + } + return socket; + } + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('Replaying proxy buffer for failed request'); + (0, assert_1.default)(s.listenerCount('data') > 0); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + return fakeSocket; + } +} +HttpsProxyAgent.protocols = ['http', 'https']; +exports.HttpsProxyAgent = HttpsProxyAgent; +function resume(socket) { + socket.resume(); +} +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 595: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parseProxyResponse = void 0; +const debug_1 = __importDefault(__nccwpck_require__(8237)); +const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response'); +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once('readable', read); + } + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('readable', read); + } + function onend() { + cleanup(); + debug('onend'); + reject(new Error('Proxy connection ended before receiving CONNECT response')); + } + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + const headerParts = buffered + .slice(0, endOfHeaders) + .toString('ascii') + .split('\r\n'); + const firstLine = headerParts.shift(); + if (!firstLine) { + socket.destroy(); + return reject(new Error('No header received from proxy CONNECT response')); + } + const firstLineParts = firstLine.split(' '); + const statusCode = +firstLineParts[1]; + const statusText = firstLineParts.slice(2).join(' '); + const headers = {}; + for (const header of headerParts) { + if (!header) + continue; + const firstColon = header.indexOf(':'); + if (firstColon === -1) { + socket.destroy(); + return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); + } + const key = header.slice(0, firstColon).toLowerCase(); + const value = header.slice(firstColon + 1).trimStart(); + const current = headers[key]; + if (typeof current === 'string') { + headers[key] = [current, value]; + } + else if (Array.isArray(current)) { + current.push(value); + } + else { + headers[key] = value; + } + } + debug('got proxy server response: %o %o', firstLine, headers); + cleanup(); + resolve({ + connect: { + statusCode, + statusText, + headers, + }, + buffered, + }); + } + socket.on('error', onerror); + socket.on('end', onend); + read(); + }); +} +exports.parseProxyResponse = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map + +/***/ }), + +/***/ 7426: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /*! @@ -7396,7 +7941,7 @@ module.exports = __nccwpck_require__(3765) /***/ }), -/***/ 2063: +/***/ 3583: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -7414,7 +7959,7 @@ module.exports = __nccwpck_require__(3765) * @private */ -var db = __nccwpck_require__(4852) +var db = __nccwpck_require__(7426) var extname = (__nccwpck_require__(1017).extname) /** @@ -7592,7 +8137,7 @@ function populateMaps (extensions, types) { /***/ }), -/***/ 3403: +/***/ 900: /***/ ((module) => { /** @@ -7761,7 +8306,7 @@ function plural(ms, msAbs, n, name) { /***/ }), -/***/ 8427: +/***/ 3329: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -7877,7 +8422,7 @@ exports.getProxyForUrl = getProxyForUrl; /***/ }), -/***/ 8509: +/***/ 5911: /***/ ((module, exports) => { exports = module.exports = SemVer @@ -9480,14 +10025,14 @@ function coerce (version, options) { /***/ }), -/***/ 1964: +/***/ 9318: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const os = __nccwpck_require__(2037); const tty = __nccwpck_require__(6224); -const hasFlag = __nccwpck_require__(4806); +const hasFlag = __nccwpck_require__(1621); const {env} = process; @@ -9623,15 +10168,15 @@ module.exports = { /***/ }), -/***/ 4592: +/***/ 4294: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(3261); +module.exports = __nccwpck_require__(4219); /***/ }), -/***/ 3261: +/***/ 4219: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -9903,7 +10448,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 336: +/***/ 2707: /***/ ((module) => { /** @@ -9936,7 +10481,7 @@ module.exports = bytesToUuid; /***/ }), -/***/ 9864: +/***/ 5859: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Unique ID creation requires a high quality random # generator. In node.js @@ -9951,11 +10496,11 @@ module.exports = function nodeRNG() { /***/ }), -/***/ 3717: +/***/ 824: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(9864); -var bytesToUuid = __nccwpck_require__(336); +var rng = __nccwpck_require__(5859); +var bytesToUuid = __nccwpck_require__(2707); function v4(options, buf, offset) { var i = buf && offset || 0; @@ -10131,19 +10676,19 @@ module.exports = require("zlib"); /***/ }), -/***/ 3447: +/***/ 8757: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors -const FormData$1 = __nccwpck_require__(5114); +const FormData$1 = __nccwpck_require__(4334); const url = __nccwpck_require__(7310); -const proxyFromEnv = __nccwpck_require__(8427); +const proxyFromEnv = __nccwpck_require__(3329); const http = __nccwpck_require__(3685); const https = __nccwpck_require__(5687); -const followRedirects = __nccwpck_require__(6820); +const followRedirects = __nccwpck_require__(7707); const zlib = __nccwpck_require__(9796); const stream = __nccwpck_require__(2781); const EventEmitter = __nccwpck_require__(2361); @@ -13953,11 +14498,12 @@ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { const fs = __nccwpck_require__(7147); -const axios = __nccwpck_require__(3447); -const core = __nccwpck_require__(4728); -const { exec } = __nccwpck_require__(5820); -const tc = __nccwpck_require__(2234); +const axios = __nccwpck_require__(8757); +const core = __nccwpck_require__(2186); +const { exec } = __nccwpck_require__(1514); +const tc = __nccwpck_require__(7784); const os = __nccwpck_require__(2037); +const { HttpsProxyAgent } = __nccwpck_require__(7219); const TRUE_VALUES = ['true', 'yes', 'y', '1']; @@ -13973,7 +14519,7 @@ function joinUrlPath(...parts) { } // Wrapper around 'authenticate' Console API endpoint -async function authenticate(url, user, pass) { +async function authenticate(url, user, pass, httpProxy) { let parsedUrl; try { parsedUrl = new URL(url); @@ -13991,6 +14537,8 @@ async function authenticate(url, user, pass) { headers: { 'Content-Type': 'application/json', }, + proxy: false, + httpsAgent: new HttpsProxyAgent(httpProxy), data: { username: user, password: pass, @@ -14004,7 +14552,7 @@ async function authenticate(url, user, pass) { } // Wrapper around 'version' Console API endpoint -async function getVersion(url, token) { +async function getVersion(url, token, httpProxy) { let parsedUrl; try { parsedUrl = new URL(url); @@ -14022,6 +14570,8 @@ async function getVersion(url, token) { headers: { 'Authorization': `Bearer ${token}`, }, + proxy: false, + httpsAgent: new HttpsProxyAgent(httpProxy) }); return res.data; } catch (err) { diff --git a/dist/licenses.txt b/dist/licenses.txt index 072e8d7..788bb49 100644 --- a/dist/licenses.txt +++ b/dist/licenses.txt @@ -71,6 +71,31 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +agent-base +MIT +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + asynckit MIT The MIT License (MIT) @@ -235,6 +260,31 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +https-proxy-agent +MIT +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + mime-db MIT (The MIT License) diff --git a/index.js b/index.js index e6a7b1a..08d56f1 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ const core = require('@actions/core'); const { exec } = require('@actions/exec'); const tc = require('@actions/tool-cache'); const os = require('os'); +const { HttpsProxyAgent } = require('https-proxy-agent'); const TRUE_VALUES = ['true', 'yes', 'y', '1']; @@ -19,7 +20,7 @@ function joinUrlPath(...parts) { } // Wrapper around 'authenticate' Console API endpoint -async function authenticate(url, user, pass) { +async function authenticate(url, user, pass, httpProxy) { let parsedUrl; try { parsedUrl = new URL(url); @@ -37,6 +38,8 @@ async function authenticate(url, user, pass) { headers: { 'Content-Type': 'application/json', }, + proxy: false, + httpsAgent: new HttpsProxyAgent(httpProxy), data: { username: user, password: pass, @@ -50,7 +53,7 @@ async function authenticate(url, user, pass) { } // Wrapper around 'version' Console API endpoint -async function getVersion(url, token) { +async function getVersion(url, token, httpProxy) { let parsedUrl; try { parsedUrl = new URL(url); @@ -68,6 +71,8 @@ async function getVersion(url, token) { headers: { 'Authorization': `Bearer ${token}`, }, + proxy: false, + httpsAgent: new HttpsProxyAgent(httpProxy) }); return res.data; } catch (err) { diff --git a/package-lock.json b/package-lock.json index 01114a1..3103e8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", "@actions/tool-cache": "^2.0.1", - "axios": "^1.1.3" + "axios": "^1.1.3", + "https-proxy-agent": "^7.0.5" }, "devDependencies": { "@vercel/ncc": "^0.34.0", @@ -189,6 +190,18 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -344,7 +357,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -733,6 +745,19 @@ "node": ">=8" } }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -917,8 +942,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -1432,6 +1456,14 @@ "dev": true, "requires": {} }, + "agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "requires": { + "debug": "^4.3.4" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1556,7 +1588,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -1835,6 +1866,15 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "requires": { + "agent-base": "^7.0.2", + "debug": "4" + } + }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -1977,8 +2017,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "natural-compare": { "version": "1.4.0", diff --git a/package.json b/package.json index 329a312..68d2526 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", "@actions/tool-cache": "^2.0.1", - "axios": "^1.1.3" + "axios": "^1.1.3", + "https-proxy-agent": "^7.0.5" }, "devDependencies": { "@vercel/ncc": "^0.34.0",