Skip to content

Commit 0cbcb9a

Browse files
Merge pull request #668 from akv-platform/disallow-implicit-dependencies
Remove implicit dependency
2 parents db9987b + 669664d commit 0cbcb9a

File tree

6 files changed

+245
-20
lines changed

6 files changed

+245
-20
lines changed

Diff for: .eslintrc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
'eslint-config-prettier'
88
],
99
parser: '@typescript-eslint/parser',
10-
plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
10+
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
1111
rules: {
1212
'@typescript-eslint/no-require-imports': 'error',
1313
'@typescript-eslint/no-non-null-assertion': 'off',
@@ -28,7 +28,8 @@ module.exports = {
2828
}
2929
],
3030
'no-control-regex': 'off',
31-
'no-constant-condition': ['error', {checkLoops: false}]
31+
'no-constant-condition': ['error', {checkLoops: false}],
32+
'node/no-extraneous-import': 'error'
3233
},
3334
overrides: [
3435
{

Diff for: .licenses/npm/@actions/http-client-2.0.1.dep.yml renamed to .licenses/npm/@actions/http-client-2.1.0.dep.yml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/cache-save/index.js

+32-2
Original file line numberDiff line numberDiff line change
@@ -3218,6 +3218,10 @@ function checkBypass(reqUrl) {
32183218
if (!reqUrl.hostname) {
32193219
return false;
32203220
}
3221+
const reqHost = reqUrl.hostname;
3222+
if (isLoopbackAddress(reqHost)) {
3223+
return true;
3224+
}
32213225
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
32223226
if (!noProxy) {
32233227
return false;
@@ -3243,13 +3247,24 @@ function checkBypass(reqUrl) {
32433247
.split(',')
32443248
.map(x => x.trim().toUpperCase())
32453249
.filter(x => x)) {
3246-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
3250+
if (upperNoProxyItem === '*' ||
3251+
upperReqHosts.some(x => x === upperNoProxyItem ||
3252+
x.endsWith(`.${upperNoProxyItem}`) ||
3253+
(upperNoProxyItem.startsWith('.') &&
3254+
x.endsWith(`${upperNoProxyItem}`)))) {
32473255
return true;
32483256
}
32493257
}
32503258
return false;
32513259
}
32523260
exports.checkBypass = checkBypass;
3261+
function isLoopbackAddress(host) {
3262+
const hostLower = host.toLowerCase();
3263+
return (hostLower === 'localhost' ||
3264+
hostLower.startsWith('127.') ||
3265+
hostLower.startsWith('[::1]') ||
3266+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
3267+
}
32533268
//# sourceMappingURL=proxy.js.map
32543269

32553270
/***/ }),
@@ -6582,6 +6597,10 @@ function checkBypass(reqUrl) {
65826597
if (!reqUrl.hostname) {
65836598
return false;
65846599
}
6600+
const reqHost = reqUrl.hostname;
6601+
if (isLoopbackAddress(reqHost)) {
6602+
return true;
6603+
}
65856604
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
65866605
if (!noProxy) {
65876606
return false;
@@ -6607,13 +6626,24 @@ function checkBypass(reqUrl) {
66076626
.split(',')
66086627
.map(x => x.trim().toUpperCase())
66096628
.filter(x => x)) {
6610-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
6629+
if (upperNoProxyItem === '*' ||
6630+
upperReqHosts.some(x => x === upperNoProxyItem ||
6631+
x.endsWith(`.${upperNoProxyItem}`) ||
6632+
(upperNoProxyItem.startsWith('.') &&
6633+
x.endsWith(`${upperNoProxyItem}`)))) {
66116634
return true;
66126635
}
66136636
}
66146637
return false;
66156638
}
66166639
exports.checkBypass = checkBypass;
6640+
function isLoopbackAddress(host) {
6641+
const hostLower = host.toLowerCase();
6642+
return (hostLower === 'localhost' ||
6643+
hostLower.startsWith('127.') ||
6644+
hostLower.startsWith('[::1]') ||
6645+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
6646+
}
66176647
//# sourceMappingURL=proxy.js.map
66186648

66196649
/***/ }),

Diff for: dist/setup/index.js

+32-2
Original file line numberDiff line numberDiff line change
@@ -3218,6 +3218,10 @@ function checkBypass(reqUrl) {
32183218
if (!reqUrl.hostname) {
32193219
return false;
32203220
}
3221+
const reqHost = reqUrl.hostname;
3222+
if (isLoopbackAddress(reqHost)) {
3223+
return true;
3224+
}
32213225
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
32223226
if (!noProxy) {
32233227
return false;
@@ -3243,13 +3247,24 @@ function checkBypass(reqUrl) {
32433247
.split(',')
32443248
.map(x => x.trim().toUpperCase())
32453249
.filter(x => x)) {
3246-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
3250+
if (upperNoProxyItem === '*' ||
3251+
upperReqHosts.some(x => x === upperNoProxyItem ||
3252+
x.endsWith(`.${upperNoProxyItem}`) ||
3253+
(upperNoProxyItem.startsWith('.') &&
3254+
x.endsWith(`${upperNoProxyItem}`)))) {
32473255
return true;
32483256
}
32493257
}
32503258
return false;
32513259
}
32523260
exports.checkBypass = checkBypass;
3261+
function isLoopbackAddress(host) {
3262+
const hostLower = host.toLowerCase();
3263+
return (hostLower === 'localhost' ||
3264+
hostLower.startsWith('127.') ||
3265+
hostLower.startsWith('[::1]') ||
3266+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
3267+
}
32533268
//# sourceMappingURL=proxy.js.map
32543269

32553270
/***/ }),
@@ -6582,6 +6597,10 @@ function checkBypass(reqUrl) {
65826597
if (!reqUrl.hostname) {
65836598
return false;
65846599
}
6600+
const reqHost = reqUrl.hostname;
6601+
if (isLoopbackAddress(reqHost)) {
6602+
return true;
6603+
}
65856604
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
65866605
if (!noProxy) {
65876606
return false;
@@ -6607,13 +6626,24 @@ function checkBypass(reqUrl) {
66076626
.split(',')
66086627
.map(x => x.trim().toUpperCase())
66096628
.filter(x => x)) {
6610-
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
6629+
if (upperNoProxyItem === '*' ||
6630+
upperReqHosts.some(x => x === upperNoProxyItem ||
6631+
x.endsWith(`.${upperNoProxyItem}`) ||
6632+
(upperNoProxyItem.startsWith('.') &&
6633+
x.endsWith(`${upperNoProxyItem}`)))) {
66116634
return true;
66126635
}
66136636
}
66146637
return false;
66156638
}
66166639
exports.checkBypass = checkBypass;
6640+
function isLoopbackAddress(host) {
6641+
const hostLower = host.toLowerCase();
6642+
return (hostLower === 'localhost' ||
6643+
hostLower.startsWith('127.') ||
6644+
hostLower.startsWith('[::1]') ||
6645+
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
6646+
}
66176647
//# sourceMappingURL=proxy.js.map
66186648

66196649
/***/ }),

0 commit comments

Comments
 (0)