New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@forge/csp

Package Overview
Dependencies
Maintainers
8
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/csp - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0-next.0

6

CHANGELOG.md
# @forge/csp
## 1.5.0-next.0
### Minor Changes
- 638194f: Fix logic to detect missing fetch egress permission
## 1.4.0

@@ -4,0 +10,0 @@

2

out/egress/egress-filtering-service.d.ts

@@ -7,6 +7,6 @@ export declare class EgressFilteringService {

private safeURL;
private withoutQueryString;
isValidUrl(url: string): boolean;
private domainCheck;
private domainIsAllowed;
}
//# sourceMappingURL=egress-filtering-service.d.ts.map

@@ -11,3 +11,3 @@ "use strict";

.filter((domainOrURL) => !domainOrURL.startsWith('*'))
.map((url) => this.safeURL(url).toString());
.map((url) => this.safeURL(url));
this.wildcardDomains = allowList

@@ -23,7 +23,2 @@ .filter((domainOrURL) => domainOrURL !== '*')

}
withoutQueryString(url) {
const parsedURL = this.safeURL(url);
parsedURL.search = '';
return parsedURL;
}
isValidUrl(url) {

@@ -33,11 +28,7 @@ if (this.allowsEverything) {

}
const urlWithoutQuery = this.withoutQueryString(url);
if (this.URLs.includes(url) || this.URLs.includes(urlWithoutQuery.toString())) {
return true;
}
return this.domainIsAllowed(urlWithoutQuery);
return this.domainIsAllowed(this.safeURL(url));
}
domainIsAllowed(domain) {
const hostnameMatchedProtocol = this.wildcardDomains
.filter((wildcarded) => wildcarded.protocol === domain.protocol)
domainCheck(domain, allowList) {
const hostnameMatchedProtocol = allowList
.filter((allowed) => allowed.protocol === domain.protocol)
.map((url) => url.hostname);

@@ -48,3 +39,12 @@ return (micromatch_1.default([domain.hostname], hostnameMatchedProtocol, {

}
domainIsAllowed(domain) {
if (this.domainCheck(domain, this.URLs)) {
return true;
}
if (this.domainCheck(domain, this.wildcardDomains)) {
return true;
}
return false;
}
}
exports.EgressFilteringService = EgressFilteringService;
{
"name": "@forge/csp",
"version": "1.4.0",
"version": "1.5.0-next.0",
"description": "Contains the CSP configuration for Custom UI resources in Forge",

@@ -14,4 +14,4 @@ "main": "out/index.js",

"devDependencies": {
"@forge/cli-shared": "^1.1.1",
"@forge/manifest": "^1.3.1",
"@forge/cli-shared": "^1.2.1-next.0",
"@forge/manifest": "^1.3.3-next.0",
"@types/jest": "^26.0.0"

@@ -18,0 +18,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc