mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-03-15 09:20:58 -04:00
chore: Update dist
This commit is contained in:
11
dist/cleanup/index.js
generated
vendored
11
dist/cleanup/index.js
generated
vendored
@@ -48053,6 +48053,8 @@ function translateEnvVariables() {
|
|||||||
'SPECIAL_CHARACTERS_WORKAROUND',
|
'SPECIAL_CHARACTERS_WORKAROUND',
|
||||||
'USE_EXISTING_CREDENTIALS',
|
'USE_EXISTING_CREDENTIALS',
|
||||||
];
|
];
|
||||||
|
// Treat HTTPS_PROXY as HTTP_PROXY. Precedence is HTTPS_PROXY > HTTP_PROXY
|
||||||
|
process.env.HTTP_PROXY = process.env.HTTPS_PROXY || process.env.HTTP_PROXY || undefined;
|
||||||
for (const envVar of envVars) {
|
for (const envVar of envVars) {
|
||||||
if (process.env[envVar]) {
|
if (process.env[envVar]) {
|
||||||
const inputKey = `INPUT_${envVar.replace(/_/g, '-')}`;
|
const inputKey = `INPUT_${envVar.replace(/_/g, '-')}`;
|
||||||
@@ -48122,13 +48124,16 @@ async function exportAccountId(credentialsClient, maskAccountId) {
|
|||||||
const client = credentialsClient.stsClient;
|
const client = credentialsClient.stsClient;
|
||||||
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
|
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
|
||||||
const accountId = identity.Account;
|
const accountId = identity.Account;
|
||||||
if (!accountId) {
|
const arn = identity.Arn;
|
||||||
throw new Error('Could not get Account ID from STS. Did you set credentials?');
|
if (!accountId || !arn) {
|
||||||
|
throw new Error('Could not get Account ID or ARN from STS. Did you set credentials?');
|
||||||
}
|
}
|
||||||
if (maskAccountId) {
|
if (maskAccountId) {
|
||||||
core.setSecret(accountId);
|
core.setSecret(accountId);
|
||||||
|
core.setSecret(arn);
|
||||||
}
|
}
|
||||||
core.setOutput('aws-account-id', accountId);
|
core.setOutput('aws-account-id', accountId);
|
||||||
|
core.setOutput('authenticated-arn', arn);
|
||||||
return accountId;
|
return accountId;
|
||||||
}
|
}
|
||||||
// Tags have a more restrictive set of acceptable characters than GitHub environment variables can.
|
// Tags have a more restrictive set of acceptable characters than GitHub environment variables can.
|
||||||
@@ -50118,7 +50123,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sso","descrip
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.858.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.858.0","@aws-sdk/credential-provider-node":"3.858.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.858.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.848.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.858.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.7.2","@smithy/fetch-http-handler":"^5.1.0","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.17","@smithy/middleware-retry":"^4.1.18","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.1.0","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.9","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.25","@smithy/util-defaults-mode-node":"^4.0.25","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.859.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.858.0","@aws-sdk/credential-provider-node":"3.859.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.858.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.848.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.858.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.7.2","@smithy/fetch-http-handler":"^5.1.0","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.17","@smithy/middleware-retry":"^4.1.18","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.1.0","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.9","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.25","@smithy/util-defaults-mode-node":"^4.0.25","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
735
dist/index.js
generated
vendored
735
dist/index.js
generated
vendored
@@ -303,6 +303,8 @@ function translateEnvVariables() {
|
|||||||
'SPECIAL_CHARACTERS_WORKAROUND',
|
'SPECIAL_CHARACTERS_WORKAROUND',
|
||||||
'USE_EXISTING_CREDENTIALS',
|
'USE_EXISTING_CREDENTIALS',
|
||||||
];
|
];
|
||||||
|
// Treat HTTPS_PROXY as HTTP_PROXY. Precedence is HTTPS_PROXY > HTTP_PROXY
|
||||||
|
process.env.HTTP_PROXY = process.env.HTTPS_PROXY || process.env.HTTP_PROXY || undefined;
|
||||||
for (const envVar of envVars) {
|
for (const envVar of envVars) {
|
||||||
if (process.env[envVar]) {
|
if (process.env[envVar]) {
|
||||||
const inputKey = `INPUT_${envVar.replace(/_/g, '-')}`;
|
const inputKey = `INPUT_${envVar.replace(/_/g, '-')}`;
|
||||||
@@ -372,13 +374,16 @@ async function exportAccountId(credentialsClient, maskAccountId) {
|
|||||||
const client = credentialsClient.stsClient;
|
const client = credentialsClient.stsClient;
|
||||||
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
|
const identity = await client.send(new client_sts_1.GetCallerIdentityCommand({}));
|
||||||
const accountId = identity.Account;
|
const accountId = identity.Account;
|
||||||
if (!accountId) {
|
const arn = identity.Arn;
|
||||||
throw new Error('Could not get Account ID from STS. Did you set credentials?');
|
if (!accountId || !arn) {
|
||||||
|
throw new Error('Could not get Account ID or ARN from STS. Did you set credentials?');
|
||||||
}
|
}
|
||||||
if (maskAccountId) {
|
if (maskAccountId) {
|
||||||
core.setSecret(accountId);
|
core.setSecret(accountId);
|
||||||
|
core.setSecret(arn);
|
||||||
}
|
}
|
||||||
core.setOutput('aws-account-id', accountId);
|
core.setOutput('aws-account-id', accountId);
|
||||||
|
core.setOutput('authenticated-arn', arn);
|
||||||
return accountId;
|
return accountId;
|
||||||
}
|
}
|
||||||
// Tags have a more restrictive set of acceptable characters than GitHub environment variables can.
|
// Tags have a more restrictive set of acceptable characters than GitHub environment variables can.
|
||||||
@@ -534,7 +539,7 @@ async function run() {
|
|||||||
const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
|
const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
|
||||||
const roleSkipSessionTaggingInput = core.getInput('role-skip-session-tagging', { required: false }) || 'false';
|
const roleSkipSessionTaggingInput = core.getInput('role-skip-session-tagging', { required: false }) || 'false';
|
||||||
const roleSkipSessionTagging = roleSkipSessionTaggingInput.toLowerCase() === 'true';
|
const roleSkipSessionTagging = roleSkipSessionTaggingInput.toLowerCase() === 'true';
|
||||||
const proxyServer = core.getInput('http-proxy', { required: false });
|
const proxyServer = core.getInput('http-proxy', { required: false }) || process.env.HTTP_PROXY;
|
||||||
const inlineSessionPolicy = core.getInput('inline-session-policy', {
|
const inlineSessionPolicy = core.getInput('inline-session-policy', {
|
||||||
required: false,
|
required: false,
|
||||||
});
|
});
|
||||||
@@ -25001,238 +25006,261 @@ var toUtf8 = /* @__PURE__ */ __name((input) => {
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 8207:
|
/***/ 5183:
|
||||||
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
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;
|
||||||
};
|
};
|
||||||
const events_1 = __nccwpck_require__(4434);
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const debug_1 = __importDefault(__nccwpck_require__(2830));
|
exports.req = exports.json = exports.toBuffer = void 0;
|
||||||
const promisify_1 = __importDefault(__nccwpck_require__(8067));
|
const http = __importStar(__nccwpck_require__(8611));
|
||||||
const debug = debug_1.default('agent-base');
|
const https = __importStar(__nccwpck_require__(5692));
|
||||||
function isAgent(v) {
|
async function toBuffer(stream) {
|
||||||
return Boolean(v) && typeof v.addRequest === 'function';
|
let length = 0;
|
||||||
|
const chunks = [];
|
||||||
|
for await (const chunk of stream) {
|
||||||
|
length += chunk.length;
|
||||||
|
chunks.push(chunk);
|
||||||
|
}
|
||||||
|
return Buffer.concat(chunks, length);
|
||||||
}
|
}
|
||||||
function isSecureEndpoint() {
|
exports.toBuffer = toBuffer;
|
||||||
const { stack } = new Error();
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
if (typeof stack !== 'string')
|
async function json(stream) {
|
||||||
return false;
|
const buf = await toBuffer(stream);
|
||||||
return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
|
const str = buf.toString('utf8');
|
||||||
}
|
|
||||||
function createAgent(callback, opts) {
|
|
||||||
return new createAgent.Agent(callback, opts);
|
|
||||||
}
|
|
||||||
(function (createAgent) {
|
|
||||||
/**
|
|
||||||
* Base `http.Agent` implementation.
|
|
||||||
* No pooling/keep-alive is implemented by default.
|
|
||||||
*
|
|
||||||
* @param {Function} callback
|
|
||||||
* @api public
|
|
||||||
*/
|
|
||||||
class Agent extends events_1.EventEmitter {
|
|
||||||
constructor(callback, _opts) {
|
|
||||||
super();
|
|
||||||
let opts = _opts;
|
|
||||||
if (typeof callback === 'function') {
|
|
||||||
this.callback = callback;
|
|
||||||
}
|
|
||||||
else if (callback) {
|
|
||||||
opts = callback;
|
|
||||||
}
|
|
||||||
// Timeout for the socket to be returned from the callback
|
|
||||||
this.timeout = null;
|
|
||||||
if (opts && typeof opts.timeout === 'number') {
|
|
||||||
this.timeout = opts.timeout;
|
|
||||||
}
|
|
||||||
// These aren't actually used by `agent-base`, but are required
|
|
||||||
// for the TypeScript definition files in `@types/node` :/
|
|
||||||
this.maxFreeSockets = 1;
|
|
||||||
this.maxSockets = 1;
|
|
||||||
this.maxTotalSockets = Infinity;
|
|
||||||
this.sockets = {};
|
|
||||||
this.freeSockets = {};
|
|
||||||
this.requests = {};
|
|
||||||
this.options = {};
|
|
||||||
}
|
|
||||||
get defaultPort() {
|
|
||||||
if (typeof this.explicitDefaultPort === 'number') {
|
|
||||||
return this.explicitDefaultPort;
|
|
||||||
}
|
|
||||||
return isSecureEndpoint() ? 443 : 80;
|
|
||||||
}
|
|
||||||
set defaultPort(v) {
|
|
||||||
this.explicitDefaultPort = v;
|
|
||||||
}
|
|
||||||
get protocol() {
|
|
||||||
if (typeof this.explicitProtocol === 'string') {
|
|
||||||
return this.explicitProtocol;
|
|
||||||
}
|
|
||||||
return isSecureEndpoint() ? 'https:' : 'http:';
|
|
||||||
}
|
|
||||||
set protocol(v) {
|
|
||||||
this.explicitProtocol = v;
|
|
||||||
}
|
|
||||||
callback(req, opts, fn) {
|
|
||||||
throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Called by node-core's "_http_client.js" module when creating
|
|
||||||
* a new HTTP request with this Agent instance.
|
|
||||||
*
|
|
||||||
* @api public
|
|
||||||
*/
|
|
||||||
addRequest(req, _opts) {
|
|
||||||
const opts = Object.assign({}, _opts);
|
|
||||||
if (typeof opts.secureEndpoint !== 'boolean') {
|
|
||||||
opts.secureEndpoint = isSecureEndpoint();
|
|
||||||
}
|
|
||||||
if (opts.host == null) {
|
|
||||||
opts.host = 'localhost';
|
|
||||||
}
|
|
||||||
if (opts.port == null) {
|
|
||||||
opts.port = opts.secureEndpoint ? 443 : 80;
|
|
||||||
}
|
|
||||||
if (opts.protocol == null) {
|
|
||||||
opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
|
|
||||||
}
|
|
||||||
if (opts.host && opts.path) {
|
|
||||||
// If both a `host` and `path` are specified then it's most
|
|
||||||
// likely the result of a `url.parse()` call... we need to
|
|
||||||
// remove the `path` portion so that `net.connect()` doesn't
|
|
||||||
// attempt to open that as a unix socket file.
|
|
||||||
delete opts.path;
|
|
||||||
}
|
|
||||||
delete opts.agent;
|
|
||||||
delete opts.hostname;
|
|
||||||
delete opts._defaultAgent;
|
|
||||||
delete opts.defaultPort;
|
|
||||||
delete opts.createConnection;
|
|
||||||
// Hint to use "Connection: close"
|
|
||||||
// XXX: non-documented `http` module API :(
|
|
||||||
req._last = true;
|
|
||||||
req.shouldKeepAlive = false;
|
|
||||||
let timedOut = false;
|
|
||||||
let timeoutId = null;
|
|
||||||
const timeoutMs = opts.timeout || this.timeout;
|
|
||||||
const onerror = (err) => {
|
|
||||||
if (req._hadError)
|
|
||||||
return;
|
|
||||||
req.emit('error', err);
|
|
||||||
// For Safety. Some additional errors might fire later on
|
|
||||||
// and we need to make sure we don't double-fire the error event.
|
|
||||||
req._hadError = true;
|
|
||||||
};
|
|
||||||
const ontimeout = () => {
|
|
||||||
timeoutId = null;
|
|
||||||
timedOut = true;
|
|
||||||
const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
|
|
||||||
err.code = 'ETIMEOUT';
|
|
||||||
onerror(err);
|
|
||||||
};
|
|
||||||
const callbackError = (err) => {
|
|
||||||
if (timedOut)
|
|
||||||
return;
|
|
||||||
if (timeoutId !== null) {
|
|
||||||
clearTimeout(timeoutId);
|
|
||||||
timeoutId = null;
|
|
||||||
}
|
|
||||||
onerror(err);
|
|
||||||
};
|
|
||||||
const onsocket = (socket) => {
|
|
||||||
if (timedOut)
|
|
||||||
return;
|
|
||||||
if (timeoutId != null) {
|
|
||||||
clearTimeout(timeoutId);
|
|
||||||
timeoutId = null;
|
|
||||||
}
|
|
||||||
if (isAgent(socket)) {
|
|
||||||
// `socket` is actually an `http.Agent` instance, so
|
|
||||||
// relinquish responsibility for this `req` to the Agent
|
|
||||||
// from here on
|
|
||||||
debug('Callback returned another Agent instance %o', socket.constructor.name);
|
|
||||||
socket.addRequest(req, opts);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (socket) {
|
|
||||||
socket.once('free', () => {
|
|
||||||
this.freeSocket(socket, opts);
|
|
||||||
});
|
|
||||||
req.onSocket(socket);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
|
|
||||||
onerror(err);
|
|
||||||
};
|
|
||||||
if (typeof this.callback !== 'function') {
|
|
||||||
onerror(new Error('`callback` is not defined'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.promisifiedCallback) {
|
|
||||||
if (this.callback.length >= 3) {
|
|
||||||
debug('Converting legacy callback function to promise');
|
|
||||||
this.promisifiedCallback = promisify_1.default(this.callback);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.promisifiedCallback = this.callback;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (typeof timeoutMs === 'number' && timeoutMs > 0) {
|
|
||||||
timeoutId = setTimeout(ontimeout, timeoutMs);
|
|
||||||
}
|
|
||||||
if ('port' in opts && typeof opts.port !== 'number') {
|
|
||||||
opts.port = Number(opts.port);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
|
return JSON.parse(str);
|
||||||
Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (_err) {
|
||||||
Promise.reject(err).catch(callbackError);
|
const err = _err;
|
||||||
|
err.message += ` (input: ${str})`;
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
freeSocket(socket, opts) {
|
exports.json = json;
|
||||||
debug('Freeing socket %o %o', socket.constructor.name, opts);
|
function req(url, opts = {}) {
|
||||||
socket.destroy();
|
const href = typeof url === 'string' ? url : url.href;
|
||||||
}
|
const req = (href.startsWith('https:') ? https : http).request(url, opts);
|
||||||
destroy() {
|
const promise = new Promise((resolve, reject) => {
|
||||||
debug('Destroying agent %o', this.constructor.name);
|
req
|
||||||
}
|
.once('response', resolve)
|
||||||
}
|
.once('error', reject)
|
||||||
createAgent.Agent = Agent;
|
.end();
|
||||||
// So that `instanceof` works correctly
|
});
|
||||||
createAgent.prototype = createAgent.Agent.prototype;
|
req.then = promise.then.bind(promise);
|
||||||
})(createAgent || (createAgent = {}));
|
return req;
|
||||||
module.exports = createAgent;
|
}
|
||||||
//# sourceMappingURL=index.js.map
|
exports.req = req;
|
||||||
|
//# sourceMappingURL=helpers.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 8067:
|
/***/ 8894:
|
||||||
/***/ ((__unused_webpack_module, exports) => {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"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 }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
function promisify(fn) {
|
exports.Agent = void 0;
|
||||||
return function (req, opts) {
|
const net = __importStar(__nccwpck_require__(9278));
|
||||||
return new Promise((resolve, reject) => {
|
const http = __importStar(__nccwpck_require__(8611));
|
||||||
fn.call(this, req, opts, (err, rtn) => {
|
const https_1 = __nccwpck_require__(5692);
|
||||||
if (err) {
|
__exportStar(__nccwpck_require__(5183), exports);
|
||||||
reject(err);
|
const INTERNAL = Symbol('AgentBaseInternalState');
|
||||||
|
class Agent extends http.Agent {
|
||||||
|
constructor(opts) {
|
||||||
|
super(opts);
|
||||||
|
this[INTERNAL] = {};
|
||||||
}
|
}
|
||||||
else {
|
/**
|
||||||
resolve(rtn);
|
* 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 = 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) {
|
||||||
|
try {
|
||||||
|
// @ts-expect-error `addRequest()` isn't defined in `@types/node`
|
||||||
|
return socket.addRequest(req, connectOpts);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
return cb(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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["default"] = promisify;
|
exports.Agent = Agent;
|
||||||
//# sourceMappingURL=promisify.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -25460,7 +25488,7 @@ function save(namespaces) {
|
|||||||
function load() {
|
function load() {
|
||||||
let r;
|
let r;
|
||||||
try {
|
try {
|
||||||
r = exports.storage.getItem('debug');
|
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Swallow
|
// Swallow
|
||||||
// XXX (@Qix-) should we be logging these?
|
// XXX (@Qix-) should we be logging these?
|
||||||
@@ -25688,7 +25716,7 @@ function setup(env) {
|
|||||||
|
|
||||||
const split = (typeof namespaces === 'string' ? namespaces : '')
|
const split = (typeof namespaces === 'string' ? namespaces : '')
|
||||||
.trim()
|
.trim()
|
||||||
.replace(' ', ',')
|
.replace(/\s+/g, ',')
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
@@ -26117,32 +26145,58 @@ module.exports = (flag, argv = process.argv) => {
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 6904:
|
/***/ 3669:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
if (k2 === undefined) k2 = k;
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
}
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
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) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const net_1 = __importDefault(__nccwpck_require__(9278));
|
exports.HttpsProxyAgent = void 0;
|
||||||
const tls_1 = __importDefault(__nccwpck_require__(4756));
|
const net = __importStar(__nccwpck_require__(9278));
|
||||||
const url_1 = __importDefault(__nccwpck_require__(7016));
|
const tls = __importStar(__nccwpck_require__(4756));
|
||||||
const assert_1 = __importDefault(__nccwpck_require__(2613));
|
const assert_1 = __importDefault(__nccwpck_require__(2613));
|
||||||
const debug_1 = __importDefault(__nccwpck_require__(2830));
|
const debug_1 = __importDefault(__nccwpck_require__(2830));
|
||||||
const agent_base_1 = __nccwpck_require__(8207);
|
const agent_base_1 = __nccwpck_require__(8894);
|
||||||
const parse_proxy_response_1 = __importDefault(__nccwpck_require__(7943));
|
const url_1 = __nccwpck_require__(7016);
|
||||||
const debug = debug_1.default('https-proxy-agent:agent');
|
const parse_proxy_response_1 = __nccwpck_require__(7943);
|
||||||
|
const debug = (0, debug_1.default)('https-proxy-agent');
|
||||||
|
const setServernameFromNonIpHost = (options) => {
|
||||||
|
if (options.servername === undefined &&
|
||||||
|
options.host &&
|
||||||
|
!net.isIP(options.host)) {
|
||||||
|
return {
|
||||||
|
...options,
|
||||||
|
servername: options.host,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
||||||
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
||||||
@@ -26154,99 +26208,82 @@ const debug = debug_1.default('https-proxy-agent:agent');
|
|||||||
*
|
*
|
||||||
* `https:` requests have their socket connection upgraded to TLS once
|
* `https:` requests have their socket connection upgraded to TLS once
|
||||||
* the connection to the proxy server has been established.
|
* the connection to the proxy server has been established.
|
||||||
*
|
|
||||||
* @api public
|
|
||||||
*/
|
*/
|
||||||
class HttpsProxyAgent extends agent_base_1.Agent {
|
class HttpsProxyAgent extends agent_base_1.Agent {
|
||||||
constructor(_opts) {
|
constructor(proxy, opts) {
|
||||||
let opts;
|
|
||||||
if (typeof _opts === 'string') {
|
|
||||||
opts = url_1.default.parse(_opts);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
opts = _opts;
|
|
||||||
}
|
|
||||||
if (!opts) {
|
|
||||||
throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
|
|
||||||
}
|
|
||||||
debug('creating new HttpsProxyAgent instance: %o', opts);
|
|
||||||
super(opts);
|
super(opts);
|
||||||
const proxy = Object.assign({}, opts);
|
this.options = { path: undefined };
|
||||||
// If `true`, then connect to the proxy server over TLS.
|
this.proxy = typeof proxy === 'string' ? new url_1.URL(proxy) : proxy;
|
||||||
// Defaults to `false`.
|
this.proxyHeaders = opts?.headers ?? {};
|
||||||
this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
|
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
||||||
// Prefer `hostname` over `host`, and set the `port` if needed.
|
// Trim off the brackets from IPv6 addresses
|
||||||
proxy.host = proxy.hostname || proxy.host;
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
||||||
if (typeof proxy.port === 'string') {
|
const port = this.proxy.port
|
||||||
proxy.port = parseInt(proxy.port, 10);
|
? parseInt(this.proxy.port, 10)
|
||||||
}
|
: this.proxy.protocol === 'https:'
|
||||||
if (!proxy.port && proxy.host) {
|
? 443
|
||||||
proxy.port = this.secureProxy ? 443 : 80;
|
: 80;
|
||||||
}
|
this.connectOpts = {
|
||||||
// ALPN is supported by Node.js >= v5.
|
// Attempt to negotiate http/1.1 for proxy servers that support http/2
|
||||||
// attempt to negotiate http/1.1 for proxy servers that support http/2
|
ALPNProtocols: ['http/1.1'],
|
||||||
if (this.secureProxy && !('ALPNProtocols' in proxy)) {
|
...(opts ? omit(opts, 'headers') : null),
|
||||||
proxy.ALPNProtocols = ['http 1.1'];
|
host,
|
||||||
}
|
port,
|
||||||
if (proxy.host && proxy.path) {
|
};
|
||||||
// If both a `host` and `path` are specified then it's most likely
|
|
||||||
// the result of a `url.parse()` call... we need to remove the
|
|
||||||
// `path` portion so that `net.connect()` doesn't attempt to open
|
|
||||||
// that as a Unix socket file.
|
|
||||||
delete proxy.path;
|
|
||||||
delete proxy.pathname;
|
|
||||||
}
|
|
||||||
this.proxy = proxy;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Called when the node-core HTTP client library is creating a
|
* Called when the node-core HTTP client library is creating a
|
||||||
* new HTTP request.
|
* new HTTP request.
|
||||||
*
|
|
||||||
* @api protected
|
|
||||||
*/
|
*/
|
||||||
callback(req, opts) {
|
async connect(req, opts) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const { proxy } = this;
|
||||||
const { proxy, secureProxy } = this;
|
if (!opts.host) {
|
||||||
|
throw new TypeError('No "host" provided');
|
||||||
|
}
|
||||||
// Create a socket connection to the proxy server.
|
// Create a socket connection to the proxy server.
|
||||||
let socket;
|
let socket;
|
||||||
if (secureProxy) {
|
if (proxy.protocol === 'https:') {
|
||||||
debug('Creating `tls.Socket`: %o', proxy);
|
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
||||||
socket = tls_1.default.connect(proxy);
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
debug('Creating `net.Socket`: %o', proxy);
|
debug('Creating `net.Socket`: %o', this.connectOpts);
|
||||||
socket = net_1.default.connect(proxy);
|
socket = net.connect(this.connectOpts);
|
||||||
}
|
}
|
||||||
const headers = Object.assign({}, proxy.headers);
|
const headers = typeof this.proxyHeaders === 'function'
|
||||||
const hostname = `${opts.host}:${opts.port}`;
|
? this.proxyHeaders()
|
||||||
let payload = `CONNECT ${hostname} HTTP/1.1\r\n`;
|
: { ...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.
|
// Inject the `Proxy-Authorization` header if necessary.
|
||||||
if (proxy.auth) {
|
if (proxy.username || proxy.password) {
|
||||||
headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;
|
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
||||||
|
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
|
||||||
}
|
}
|
||||||
// The `Host` header should only include the port
|
headers.Host = `${host}:${opts.port}`;
|
||||||
// number when it is not the default port.
|
if (!headers['Proxy-Connection']) {
|
||||||
let { host, port, secureEndpoint } = opts;
|
headers['Proxy-Connection'] = this.keepAlive
|
||||||
if (!isDefaultPort(port, secureEndpoint)) {
|
? 'Keep-Alive'
|
||||||
host += `:${port}`;
|
: 'close';
|
||||||
}
|
}
|
||||||
headers.Host = host;
|
|
||||||
headers.Connection = 'close';
|
|
||||||
for (const name of Object.keys(headers)) {
|
for (const name of Object.keys(headers)) {
|
||||||
payload += `${name}: ${headers[name]}\r\n`;
|
payload += `${name}: ${headers[name]}\r\n`;
|
||||||
}
|
}
|
||||||
const proxyResponsePromise = parse_proxy_response_1.default(socket);
|
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
||||||
socket.write(`${payload}\r\n`);
|
socket.write(`${payload}\r\n`);
|
||||||
const { statusCode, buffered } = yield proxyResponsePromise;
|
const { connect, buffered } = await proxyResponsePromise;
|
||||||
if (statusCode === 200) {
|
req.emit('proxyConnect', connect);
|
||||||
|
this.emit('proxyConnect', connect, req);
|
||||||
|
if (connect.statusCode === 200) {
|
||||||
req.once('socket', resume);
|
req.once('socket', resume);
|
||||||
if (opts.secureEndpoint) {
|
if (opts.secureEndpoint) {
|
||||||
// The proxy is connecting to a TLS server, so upgrade
|
// The proxy is connecting to a TLS server, so upgrade
|
||||||
// this socket connection to a TLS connection.
|
// this socket connection to a TLS connection.
|
||||||
debug('Upgrading socket connection to TLS');
|
debug('Upgrading socket connection to TLS');
|
||||||
const servername = opts.servername || opts.host;
|
return tls.connect({
|
||||||
return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
|
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
|
||||||
servername }));
|
socket,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
@@ -26261,12 +26298,12 @@ class HttpsProxyAgent extends agent_base_1.Agent {
|
|||||||
//
|
//
|
||||||
// See: https://hackerone.com/reports/541502
|
// See: https://hackerone.com/reports/541502
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
const fakeSocket = new net_1.default.Socket({ writable: false });
|
const fakeSocket = new net.Socket({ writable: false });
|
||||||
fakeSocket.readable = true;
|
fakeSocket.readable = true;
|
||||||
// Need to wait for the "socket" event to re-play the "data" events.
|
// Need to wait for the "socket" event to re-play the "data" events.
|
||||||
req.once('socket', (s) => {
|
req.once('socket', (s) => {
|
||||||
debug('replaying proxy buffer for failed request');
|
debug('Replaying proxy buffer for failed request');
|
||||||
assert_1.default(s.listenerCount('data') > 0);
|
(0, assert_1.default)(s.listenerCount('data') > 0);
|
||||||
// Replay the "buffered" Buffer onto the fake `socket`, since at
|
// Replay the "buffered" Buffer onto the fake `socket`, since at
|
||||||
// this point the HTTP module machinery has been hooked up for
|
// this point the HTTP module machinery has been hooked up for
|
||||||
// the user.
|
// the user.
|
||||||
@@ -26274,19 +26311,13 @@ class HttpsProxyAgent extends agent_base_1.Agent {
|
|||||||
s.push(null);
|
s.push(null);
|
||||||
});
|
});
|
||||||
return fakeSocket;
|
return fakeSocket;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports["default"] = HttpsProxyAgent;
|
HttpsProxyAgent.protocols = ['http', 'https'];
|
||||||
|
exports.HttpsProxyAgent = HttpsProxyAgent;
|
||||||
function resume(socket) {
|
function resume(socket) {
|
||||||
socket.resume();
|
socket.resume();
|
||||||
}
|
}
|
||||||
function isDefaultPort(port, secure) {
|
|
||||||
return Boolean((!secure && port === 80) || (secure && port === 443));
|
|
||||||
}
|
|
||||||
function isHTTPS(protocol) {
|
|
||||||
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
|
|
||||||
}
|
|
||||||
function omit(obj, ...keys) {
|
function omit(obj, ...keys) {
|
||||||
const ret = {};
|
const ret = {};
|
||||||
let key;
|
let key;
|
||||||
@@ -26297,27 +26328,6 @@ function omit(obj, ...keys) {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=agent.js.map
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 3669:
|
|
||||||
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
const agent_1 = __importDefault(__nccwpck_require__(6904));
|
|
||||||
function createHttpsProxyAgent(opts) {
|
|
||||||
return new agent_1.default(opts);
|
|
||||||
}
|
|
||||||
(function (createHttpsProxyAgent) {
|
|
||||||
createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
|
|
||||||
createHttpsProxyAgent.prototype = agent_1.default.prototype;
|
|
||||||
})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
|
|
||||||
module.exports = createHttpsProxyAgent;
|
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -26331,8 +26341,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
exports.parseProxyResponse = void 0;
|
||||||
const debug_1 = __importDefault(__nccwpck_require__(2830));
|
const debug_1 = __importDefault(__nccwpck_require__(2830));
|
||||||
const debug = debug_1.default('https-proxy-agent:parse-proxy-response');
|
const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
|
||||||
function parseProxyResponse(socket) {
|
function parseProxyResponse(socket) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// we need to buffer any HTTP traffic that happens with the proxy before we get
|
// we need to buffer any HTTP traffic that happens with the proxy before we get
|
||||||
@@ -26351,14 +26362,12 @@ function parseProxyResponse(socket) {
|
|||||||
function cleanup() {
|
function cleanup() {
|
||||||
socket.removeListener('end', onend);
|
socket.removeListener('end', onend);
|
||||||
socket.removeListener('error', onerror);
|
socket.removeListener('error', onerror);
|
||||||
socket.removeListener('close', onclose);
|
|
||||||
socket.removeListener('readable', read);
|
socket.removeListener('readable', read);
|
||||||
}
|
}
|
||||||
function onclose(err) {
|
|
||||||
debug('onclose had error %o', err);
|
|
||||||
}
|
|
||||||
function onend() {
|
function onend() {
|
||||||
|
cleanup();
|
||||||
debug('onend');
|
debug('onend');
|
||||||
|
reject(new Error('Proxy connection ended before receiving CONNECT response'));
|
||||||
}
|
}
|
||||||
function onerror(err) {
|
function onerror(err) {
|
||||||
cleanup();
|
cleanup();
|
||||||
@@ -26376,21 +26385,57 @@ function parseProxyResponse(socket) {
|
|||||||
read();
|
read();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
|
const headerParts = buffered
|
||||||
const statusCode = +firstLine.split(' ')[1];
|
.slice(0, endOfHeaders)
|
||||||
debug('got proxy server response: %o', firstLine);
|
.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({
|
resolve({
|
||||||
|
connect: {
|
||||||
statusCode,
|
statusCode,
|
||||||
buffered
|
statusText,
|
||||||
|
headers,
|
||||||
|
},
|
||||||
|
buffered,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
socket.on('error', onerror);
|
socket.on('error', onerror);
|
||||||
socket.on('close', onclose);
|
|
||||||
socket.on('end', onend);
|
socket.on('end', onend);
|
||||||
read();
|
read();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports["default"] = parseProxyResponse;
|
exports.parseProxyResponse = parseProxyResponse;
|
||||||
//# sourceMappingURL=parse-proxy-response.js.map
|
//# sourceMappingURL=parse-proxy-response.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -52234,7 +52279,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sso","descrip
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.858.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.858.0","@aws-sdk/credential-provider-node":"3.858.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.858.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.848.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.858.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.7.2","@smithy/fetch-http-handler":"^5.1.0","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.17","@smithy/middleware-retry":"^4.1.18","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.1.0","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.9","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.25","@smithy/util-defaults-mode-node":"^4.0.25","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"name":"@aws-sdk/client-sts","description":"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native","version":"3.859.0","scripts":{"build":"concurrently \'yarn:build:cjs\' \'yarn:build:es\' \'yarn:build:types\'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts","test":"yarn g:vitest run","test:watch":"yarn g:vitest watch"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.858.0","@aws-sdk/credential-provider-node":"3.859.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.858.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.848.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.858.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.7.2","@smithy/fetch-http-handler":"^5.1.0","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.17","@smithy/middleware-retry":"^4.1.18","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.1.0","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.9","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.25","@smithy/util-defaults-mode-node":"^4.0.25","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0","tslib":"^2.6.2"},"devDependencies":{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~5.8.3"},"engines":{"node":">=18.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-sts"}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user