@forge/csp 2.1.1 → 2.1.2

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
@@ -1,5 +1,17 @@
1
1
  # @forge/csp
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fc10114: Add Metal metric ingestion endpoint to default connect-src
8
+
9
+ ## 2.1.2-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - fc10114: Add Metal metric ingestion endpoint to default connect-src
14
+
3
15
  ## 2.1.1
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"csp-injection-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-injection-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AAUvD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,iBAAiB;IAiBlB,gBAAgB,uBACD,UAAU,aACnB,iBAAiB,yBACL,MAAM,KAC5B,MAAM,EAAE,CAqDT;CACH"}
1
+ {"version":3,"file":"csp-injection-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-injection-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AAUvD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,iBAAiB;IAiBlB,gBAAgB,uBACD,UAAU,aACnB,iBAAiB,yBACL,MAAM,KAC5B,MAAM,EAAE,CAqDT;CACH"}
@@ -32,7 +32,7 @@ class CSPInjectionService {
32
32
  ].join(' ');
33
33
  const connectSrc = [
34
34
  "'self'",
35
- ...this.getConnectSrc(!!tunnelCSPReporterUri),
35
+ ...this.getConnectSrc(microsEnv, !!tunnelCSPReporterUri),
36
36
  ...this.getExistingCSPDetails(types_1.ExternalCspType.CONNECT_SRC, existingCSPDetails)
37
37
  ].join(' ');
38
38
  const scriptSrc = [
@@ -71,10 +71,13 @@ class CSPInjectionService {
71
71
  var _a;
72
72
  return (_a = cspDetails[cspType]) !== null && _a !== void 0 ? _a : [];
73
73
  }
74
- getConnectSrc(isTunnelling) {
75
- if (isTunnelling)
76
- return ['ws://localhost:*', 'http://localhost:*'];
77
- return [];
74
+ getConnectSrc(microsEnv, isTunnelling) {
75
+ const allowed = [];
76
+ if (isTunnelling) {
77
+ allowed.push(...['ws://localhost:*', 'http://localhost:*']);
78
+ }
79
+ allowed.push(`https://api.${microsEnv === 'prod' ? '' : 'stg.'}atlassian.com/metal/ingest`);
80
+ return allowed;
78
81
  }
79
82
  getFrameAncestors(microsEnv) {
80
83
  if (microsEnv === 'dev' || microsEnv === 'stg') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Contains the CSP configuration for Custom UI resources in Forge",
5
5
  "main": "out/index.js",
6
6
  "author": "Atlassian",
@@ -11,8 +11,8 @@
11
11
  "clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
12
12
  },
13
13
  "devDependencies": {
14
- "@forge/cli-shared": "^3.6.1",
15
- "@forge/manifest": "^4.7.0",
14
+ "@forge/cli-shared": "3.11.0",
15
+ "@forge/manifest": "4.10.0",
16
16
  "@types/jest": "^29.1.2"
17
17
  },
18
18
  "dependencies": {