@forge/egress 2.0.3 → 2.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,6 @@ exports.EgressFilteringService = void 0;
|
|
|
4
4
|
const minimatch_1 = require("minimatch");
|
|
5
5
|
const url_parser_1 = require("./url-parser");
|
|
6
6
|
class EgressFilteringService {
|
|
7
|
-
URLs;
|
|
8
|
-
wildcardDomains;
|
|
9
|
-
allowsEverything;
|
|
10
7
|
constructor(allowList) {
|
|
11
8
|
this.URLs = allowList.filter((domainOrURL) => !domainOrURL.startsWith('*')).map((url) => this.parseUrl(url));
|
|
12
9
|
this.wildcardDomains = allowList
|
package/out/egress/url-parser.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseUrl = void 0;
|
|
4
4
|
function parseUrl(url) {
|
|
5
|
-
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const protocol = (_b = (_a = url.match(/^(.*?:)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https:';
|
|
6
7
|
const hostname = url
|
|
7
8
|
.replace(protocol, '')
|
|
8
9
|
.replace(/^\/*/, '')
|
package/out/egress/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.getEgressesBasedOnToggles = exports.sortAndGroupEgressPermissionsByDomai
|
|
|
4
4
|
const minimatch_1 = require("minimatch");
|
|
5
5
|
const url_parser_1 = require("./url-parser");
|
|
6
6
|
const sortAndGroupEgressPermissionsByDomain = (egressAddresses) => {
|
|
7
|
-
if (egressAddresses
|
|
7
|
+
if ((egressAddresses === null || egressAddresses === void 0 ? void 0 : egressAddresses.length) === 0) {
|
|
8
8
|
return [];
|
|
9
9
|
}
|
|
10
10
|
const protocolRegex = /^(.*?:\/\/)/;
|
|
@@ -47,10 +47,11 @@ var EgressCategory;
|
|
|
47
47
|
})(EgressCategory = exports.EgressCategory || (exports.EgressCategory = {}));
|
|
48
48
|
const getEgressesBasedOnToggles = (input) => {
|
|
49
49
|
const filteredEgresses = input.egress.filter((egress) => {
|
|
50
|
-
|
|
50
|
+
var _a;
|
|
51
|
+
if (((_a = egress.category) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === EgressCategory.ANALYTICS) {
|
|
51
52
|
if (input.installationConfig) {
|
|
52
53
|
const analyticsConfig = input.installationConfig.find((config) => config.key.toUpperCase() === 'ALLOW_EGRESS_ANALYTICS');
|
|
53
|
-
return analyticsConfig
|
|
54
|
+
return (analyticsConfig === null || analyticsConfig === void 0 ? void 0 : analyticsConfig.value) !== false;
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
57
|
return input.overrides.ALLOW_EGRESS_ANALYTICS !== false;
|