Skip to content

Commit 7895df1

Browse files
author
Zachary Eisinger
committed
package updates
1 parent 308b9ff commit 7895df1

File tree

3 files changed

+2475
-6074
lines changed

3 files changed

+2475
-6074
lines changed

dist/index.js

Lines changed: 122 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4937,14 +4937,27 @@ module.exports = Parser;
49374937

49384938
"use strict";
49394939

4940+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4941+
if (k2 === undefined) k2 = k;
4942+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4943+
}) : (function(o, m, k, k2) {
4944+
if (k2 === undefined) k2 = k;
4945+
o[k2] = m[k];
4946+
}));
4947+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4948+
Object.defineProperty(o, "default", { enumerable: true, value: v });
4949+
}) : function(o, v) {
4950+
o["default"] = v;
4951+
});
49404952
var __importStar = (this && this.__importStar) || function (mod) {
49414953
if (mod && mod.__esModule) return mod;
49424954
var result = {};
4943-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
4944-
result["default"] = mod;
4955+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4956+
__setModuleDefault(result, mod);
49454957
return result;
49464958
};
49474959
Object.defineProperty(exports, "__esModule", { value: true });
4960+
exports.configAuthentication = void 0;
49484961
const fs = __importStar(__webpack_require__(747));
49494962
const path = __importStar(__webpack_require__(622));
49504963
const core = __importStar(__webpack_require__(470));
@@ -7820,22 +7833,36 @@ module.exports = require("assert");
78207833

78217834
"use strict";
78227835

7836+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7837+
if (k2 === undefined) k2 = k;
7838+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7839+
}) : (function(o, m, k, k2) {
7840+
if (k2 === undefined) k2 = k;
7841+
o[k2] = m[k];
7842+
}));
7843+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7844+
Object.defineProperty(o, "default", { enumerable: true, value: v });
7845+
}) : function(o, v) {
7846+
o["default"] = v;
7847+
});
7848+
var __importStar = (this && this.__importStar) || function (mod) {
7849+
if (mod && mod.__esModule) return mod;
7850+
var result = {};
7851+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7852+
__setModuleDefault(result, mod);
7853+
return result;
7854+
};
78237855
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7856+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78247857
return new (P || (P = Promise))(function (resolve, reject) {
78257858
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78267859
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7827-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7860+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
78287861
step((generator = generator.apply(thisArg, _arguments || [])).next());
78297862
});
78307863
};
7831-
var __importStar = (this && this.__importStar) || function (mod) {
7832-
if (mod && mod.__esModule) return mod;
7833-
var result = {};
7834-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
7835-
result["default"] = mod;
7836-
return result;
7837-
};
78387864
Object.defineProperty(exports, "__esModule", { value: true });
7865+
exports.run = void 0;
78397866
const core = __importStar(__webpack_require__(470));
78407867
const installer = __importStar(__webpack_require__(749));
78417868
const fs = __importStar(__webpack_require__(747));
@@ -13214,6 +13241,7 @@ var HttpCodes;
1321413241
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
1321513242
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
1321613243
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
13244+
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
1321713245
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
1321813246
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
1321913247
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
@@ -13238,8 +13266,18 @@ function getProxyUrl(serverUrl) {
1323813266
return proxyUrl ? proxyUrl.href : '';
1323913267
}
1324013268
exports.getProxyUrl = getProxyUrl;
13241-
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
13242-
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
13269+
const HttpRedirectCodes = [
13270+
HttpCodes.MovedPermanently,
13271+
HttpCodes.ResourceMoved,
13272+
HttpCodes.SeeOther,
13273+
HttpCodes.TemporaryRedirect,
13274+
HttpCodes.PermanentRedirect
13275+
];
13276+
const HttpResponseRetryCodes = [
13277+
HttpCodes.BadGateway,
13278+
HttpCodes.ServiceUnavailable,
13279+
HttpCodes.GatewayTimeout
13280+
];
1324313281
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
1324413282
const ExponentialBackoffCeiling = 10;
1324513283
const ExponentialBackoffTimeSlice = 5;
@@ -13364,18 +13402,22 @@ class HttpClient {
1336413402
*/
1336513403
async request(verb, requestUrl, data, headers) {
1336613404
if (this._disposed) {
13367-
throw new Error("Client has already been disposed.");
13405+
throw new Error('Client has already been disposed.');
1336813406
}
1336913407
let parsedUrl = url.parse(requestUrl);
1337013408
let info = this._prepareRequest(verb, parsedUrl, headers);
1337113409
// Only perform retries on reads since writes may not be idempotent.
13372-
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
13410+
let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
13411+
? this._maxRetries + 1
13412+
: 1;
1337313413
let numTries = 0;
1337413414
let response;
1337513415
while (numTries < maxTries) {
1337613416
response = await this.requestRaw(info, data);
1337713417
// Check if it's an authentication challenge
13378-
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
13418+
if (response &&
13419+
response.message &&
13420+
response.message.statusCode === HttpCodes.Unauthorized) {
1337913421
let authenticationHandler;
1338013422
for (let i = 0; i < this.handlers.length; i++) {
1338113423
if (this.handlers[i].canHandleAuthentication(response)) {
@@ -13393,21 +13435,32 @@ class HttpClient {
1339313435
}
1339413436
}
1339513437
let redirectsRemaining = this._maxRedirects;
13396-
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
13397-
&& this._allowRedirects
13398-
&& redirectsRemaining > 0) {
13399-
const redirectUrl = response.message.headers["location"];
13438+
while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
13439+
this._allowRedirects &&
13440+
redirectsRemaining > 0) {
13441+
const redirectUrl = response.message.headers['location'];
1340013442
if (!redirectUrl) {
1340113443
// if there's no location to redirect to, we won't
1340213444
break;
1340313445
}
1340413446
let parsedRedirectUrl = url.parse(redirectUrl);
13405-
if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
13406-
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
13447+
if (parsedUrl.protocol == 'https:' &&
13448+
parsedUrl.protocol != parsedRedirectUrl.protocol &&
13449+
!this._allowRedirectDowngrade) {
13450+
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
1340713451
}
1340813452
// we need to finish reading the response before reassigning response
1340913453
// which will leak the open socket.
1341013454
await response.readBody();
13455+
// strip authorization header if redirected to a different hostname
13456+
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
13457+
for (let header in headers) {
13458+
// header names are case insensitive
13459+
if (header.toLowerCase() === 'authorization') {
13460+
delete headers[header];
13461+
}
13462+
}
13463+
}
1341113464
// let's make the request with the new redirectUrl
1341213465
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
1341313466
response = await this.requestRaw(info, data);
@@ -13458,8 +13511,8 @@ class HttpClient {
1345813511
*/
1345913512
requestRawWithCallback(info, data, onResult) {
1346013513
let socket;
13461-
if (typeof (data) === 'string') {
13462-
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
13514+
if (typeof data === 'string') {
13515+
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
1346313516
}
1346413517
let callbackCalled = false;
1346513518
let handleResult = (err, res) => {
@@ -13472,7 +13525,7 @@ class HttpClient {
1347213525
let res = new HttpClientResponse(msg);
1347313526
handleResult(null, res);
1347413527
});
13475-
req.on('socket', (sock) => {
13528+
req.on('socket', sock => {
1347613529
socket = sock;
1347713530
});
1347813531
// If we ever get disconnected, we want the socket to timeout eventually
@@ -13487,10 +13540,10 @@ class HttpClient {
1348713540
// res should have headers
1348813541
handleResult(err, null);
1348913542
});
13490-
if (data && typeof (data) === 'string') {
13543+
if (data && typeof data === 'string') {
1349113544
req.write(data, 'utf8');
1349213545
}
13493-
if (data && typeof (data) !== 'string') {
13546+
if (data && typeof data !== 'string') {
1349413547
data.on('close', function () {
1349513548
req.end();
1349613549
});
@@ -13517,31 +13570,34 @@ class HttpClient {
1351713570
const defaultPort = usingSsl ? 443 : 80;
1351813571
info.options = {};
1351913572
info.options.host = info.parsedUrl.hostname;
13520-
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
13521-
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
13573+
info.options.port = info.parsedUrl.port
13574+
? parseInt(info.parsedUrl.port)
13575+
: defaultPort;
13576+
info.options.path =
13577+
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
1352213578
info.options.method = method;
1352313579
info.options.headers = this._mergeHeaders(headers);
1352413580
if (this.userAgent != null) {
13525-
info.options.headers["user-agent"] = this.userAgent;
13581+
info.options.headers['user-agent'] = this.userAgent;
1352613582
}
1352713583
info.options.agent = this._getAgent(info.parsedUrl);
1352813584
// gives handlers an opportunity to participate
1352913585
if (this.handlers) {
13530-
this.handlers.forEach((handler) => {
13586+
this.handlers.forEach(handler => {
1353113587
handler.prepareRequest(info.options);
1353213588
});
1353313589
}
1353413590
return info;
1353513591
}
1353613592
_mergeHeaders(headers) {
13537-
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
13593+
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
1353813594
if (this.requestOptions && this.requestOptions.headers) {
1353913595
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
1354013596
}
1354113597
return lowercaseKeys(headers || {});
1354213598
}
1354313599
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
13544-
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
13600+
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
1354513601
let clientHeader;
1354613602
if (this.requestOptions && this.requestOptions.headers) {
1354713603
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
@@ -13579,7 +13635,7 @@ class HttpClient {
1357913635
proxyAuth: proxyUrl.auth,
1358013636
host: proxyUrl.hostname,
1358113637
port: proxyUrl.port
13582-
},
13638+
}
1358313639
};
1358413640
let tunnelAgent;
1358513641
const overHttps = proxyUrl.protocol === 'https:';
@@ -13606,7 +13662,9 @@ class HttpClient {
1360613662
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
1360713663
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
1360813664
// we have to cast it to any and change it directly
13609-
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
13665+
agent.options = Object.assign(agent.options || {}, {
13666+
rejectUnauthorized: false
13667+
});
1361013668
}
1361113669
return agent;
1361213670
}
@@ -13667,7 +13725,7 @@ class HttpClient {
1366713725
msg = contents;
1366813726
}
1366913727
else {
13670-
msg = "Failed request: (" + statusCode + ")";
13728+
msg = 'Failed request: (' + statusCode + ')';
1367113729
}
1367213730
let err = new Error(msg);
1367313731
// attach statusCode and body obj (if available) to the error object
@@ -17305,22 +17363,36 @@ module.exports = require("fs");
1730517363

1730617364
"use strict";
1730717365

17366+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17367+
if (k2 === undefined) k2 = k;
17368+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17369+
}) : (function(o, m, k, k2) {
17370+
if (k2 === undefined) k2 = k;
17371+
o[k2] = m[k];
17372+
}));
17373+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17374+
Object.defineProperty(o, "default", { enumerable: true, value: v });
17375+
}) : function(o, v) {
17376+
o["default"] = v;
17377+
});
17378+
var __importStar = (this && this.__importStar) || function (mod) {
17379+
if (mod && mod.__esModule) return mod;
17380+
var result = {};
17381+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17382+
__setModuleDefault(result, mod);
17383+
return result;
17384+
};
1730817385
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17386+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1730917387
return new (P || (P = Promise))(function (resolve, reject) {
1731017388
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1731117389
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17312-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
17390+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1731317391
step((generator = generator.apply(thisArg, _arguments || [])).next());
1731417392
});
1731517393
};
17316-
var __importStar = (this && this.__importStar) || function (mod) {
17317-
if (mod && mod.__esModule) return mod;
17318-
var result = {};
17319-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
17320-
result["default"] = mod;
17321-
return result;
17322-
};
1732317394
Object.defineProperty(exports, "__esModule", { value: true });
17395+
exports.DotnetCoreInstaller = void 0;
1732417396
// Load tempDirectory before it gets wiped by tool-cache
1732517397
let tempDirectory = process.env['RUNNER_TEMPDIRECTORY'] || '';
1732617398
const core = __importStar(__webpack_require__(470));
@@ -21153,12 +21225,10 @@ function getProxyUrl(reqUrl) {
2115321225
}
2115421226
let proxyVar;
2115521227
if (usingSsl) {
21156-
proxyVar = process.env["https_proxy"] ||
21157-
process.env["HTTPS_PROXY"];
21228+
proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
2115821229
}
2115921230
else {
21160-
proxyVar = process.env["http_proxy"] ||
21161-
process.env["HTTP_PROXY"];
21231+
proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
2116221232
}
2116321233
if (proxyVar) {
2116421234
proxyUrl = url.parse(proxyVar);
@@ -21170,7 +21240,7 @@ function checkBypass(reqUrl) {
2117021240
if (!reqUrl.hostname) {
2117121241
return false;
2117221242
}
21173-
let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
21243+
let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
2117421244
if (!noProxy) {
2117521245
return false;
2117621246
}
@@ -21191,7 +21261,10 @@ function checkBypass(reqUrl) {
2119121261
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
2119221262
}
2119321263
// Compare request host against noproxy
21194-
for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
21264+
for (let upperNoProxyItem of noProxy
21265+
.split(',')
21266+
.map(x => x.trim().toUpperCase())
21267+
.filter(x => x)) {
2119521268
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
2119621269
return true;
2119721270
}

0 commit comments

Comments
 (0)