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
2
Versions
178
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 2.1.4 to 2.1.5-experimental-343ae22

26

CHANGELOG.md
# @forge/csp
## 2.1.5-experimental-343ae22
### Major Changes
- 2292902: Update CSP injection to include hostname
## 2.1.5
### Patch Changes
- 8105c45: Bumping dependencies via Renovate:
- @types/jest
- jest
- jest-environment-jsdom
## 2.1.5-next.0
### Patch Changes
- 8105c45: Bumping dependencies via Renovate:
- @types/jest
- jest
- jest-environment-jsdom
## 2.1.4

@@ -4,0 +30,0 @@

8

out/csp/csp-injection-service.d.ts

@@ -8,5 +8,11 @@ import type { LambdaEnvironment } from '@forge/cli-shared';

private getConnectSrc;
private isCurrentHostAllowed;
private getFrameAncestors;
getInjectableCSP: (existingCSPDetails: CSPDetails, microsEnv: LambdaEnvironment, tunnelCSPReporterUri?: string) => string[];
getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname }: {
existingCSPDetails: CSPDetails;
microsEnv: LambdaEnvironment;
hostname?: string | undefined;
tunnelCSPReporterUri?: string | undefined;
}) => string[];
}
//# sourceMappingURL=csp-injection-service.d.ts.map

24

out/csp/csp-injection-service.js

@@ -13,6 +13,6 @@ "use strict";

constructor() {
this.getInjectableCSP = (existingCSPDetails, microsEnv, tunnelCSPReporterUri) => {
this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname }) => {
const reportUri = tunnelCSPReporterUri || this.getCSPReportUri(microsEnv);
const defaultSrc = `'self'`;
const frameAncestors = ["'self'", ...this.getFrameAncestors(microsEnv)].join(' ');
const frameAncestors = ["'self'", ...this.getFrameAncestors(microsEnv, hostname)].join(' ');
const frameSrc = ["'self'", ...this.getExistingCSPDetails(types_1.ExternalCspType.FRAME_SRC, existingCSPDetails)].join(' ');

@@ -87,5 +87,9 @@ const fontSrc = ["'self'", ...this.getExistingCSPDetails(types_1.ExternalCspType.FONT_SRC, existingCSPDetails)].join(' ');

}
getFrameAncestors(microsEnv) {
isCurrentHostAllowed(hostname) {
return true;
}
getFrameAncestors(microsEnv, hostname) {
let frameAncestors = [];
if (microsEnv === 'dev' || microsEnv === 'stg') {
return [
frameAncestors = [
'*.jira-dev.com',

@@ -97,8 +101,16 @@ 'http://localhost:*',

'*.atl-paas.net',
'*.stg.atlassian.com'
'*.stg.atlassian.com',
'*.testing.com'
];
}
return ['*.atlassian.net', 'bitbucket.org', '*.jira.com', '*.atlassian.com'];
else {
frameAncestors = ['*.atlassian.net', 'bitbucket.org', '*.jira.com', '*.atlassian.com'];
}
if (hostname && this.isCurrentHostAllowed(hostname)) {
frameAncestors.push(hostname);
frameAncestors = [...new Set(frameAncestors)];
}
return frameAncestors;
}
}
exports.CSPInjectionService = CSPInjectionService;
{
"name": "@forge/csp",
"version": "2.1.4",
"version": "2.1.5-experimental-343ae22",
"description": "Contains the CSP configuration for Custom UI resources in Forge",

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

"devDependencies": {
"@forge/cli-shared": "3.16.0",
"@forge/manifest": "4.17.0",
"@types/jest": "^29.1.2"
"@forge/cli-shared": "3.17.2-next.6",
"@forge/manifest": "4.19.1-next.3",
"@types/jest": "^29.5.3"
},

@@ -19,0 +19,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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