@forge/egress
Advanced tools
+6
-0
| # @forge/egress | ||
| ## 1.2.1-next.0 | ||
| ### Patch Changes | ||
| - f18ccd86: Fixed bug greedily extracting the protocol from provided egress domains | ||
| ## 1.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -5,3 +5,2 @@ export declare class EgressFilteringService { | ||
| private readonly allowsEverything; | ||
| private readonly DEFAULT_PROTOCOL; | ||
| constructor(allowList: string[]); | ||
@@ -8,0 +7,0 @@ private parseUrl; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"egress-filtering-service.d.ts","sourceRoot":"","sources":["../../src/egress/egress-filtering-service.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAc;gBAEnC,SAAS,EAAE,MAAM,EAAE;IAU/B,OAAO,CAAC,QAAQ;IAQT,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IASvC,OAAO,CAAC,aAAa;CAKtB"} | ||
| {"version":3,"file":"egress-filtering-service.d.ts","sourceRoot":"","sources":["../../src/egress/egress-filtering-service.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAY;IACjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAE/B,SAAS,EAAE,MAAM,EAAE;IAU/B,OAAO,CAAC,QAAQ;IAKT,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IASvC,OAAO,CAAC,aAAa;CAKtB"} |
@@ -9,3 +9,2 @@ "use strict"; | ||
| constructor(allowList) { | ||
| this.DEFAULT_PROTOCOL = 'https://'; | ||
| this.URLs = allowList.filter((domainOrURL) => !domainOrURL.startsWith('*')).map((url) => this.parseUrl(url)); | ||
@@ -19,5 +18,3 @@ this.wildcardDomains = allowList | ||
| parseUrl(url) { | ||
| const protocolRegex = /^(.*:\/\/)/; | ||
| const urlWithProtocol = protocolRegex.test(url) ? url : `${this.DEFAULT_PROTOCOL}${url}`; | ||
| return (0, url_parser_1.parseUrl)(urlWithProtocol); | ||
| return (0, url_parser_1.parseUrl)(url); | ||
| } | ||
@@ -24,0 +21,0 @@ isValidUrl(url) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"url-parser.d.ts","sourceRoot":"","sources":["../../src/egress/url-parser.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;AAKzD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAK7C"} | ||
| {"version":3,"file":"url-parser.d.ts","sourceRoot":"","sources":["../../src/egress/url-parser.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;AAKzD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ7C"} |
@@ -6,6 +6,9 @@ "use strict"; | ||
| var _a, _b; | ||
| const protocol = (_b = (_a = url.match(/^(.*:\/\/)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https://'; | ||
| const hostname = url.replace(protocol, '').split(/[\/?]/)[0]; | ||
| const protocol = (_b = (_a = url.match(/^(.*?:)/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 'https:'; | ||
| const hostname = url | ||
| .replace(protocol, '') | ||
| .replace(/^\/*/, '') | ||
| .split(/[\?\/]/)[0]; | ||
| return { protocol, hostname }; | ||
| } | ||
| exports.parseUrl = parseUrl; |
+1
-1
| { | ||
| "name": "@forge/egress", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1-next.0", | ||
| "description": "Helpers and utils for egress implementation in Forge apps", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
7178
-1.43%101
-0.98%2
100%