@forge/csp 4.0.1-next.0 → 4.0.1-next.1-experimental-effab31

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,22 @@
1
1
  # @forge/csp
2
2
 
3
+ ## 4.0.1-next.1-experimental-effab31
4
+
5
+ ### Minor Changes
6
+
7
+ - effab31: Bumped cheerio from 0.22 to 1.1
8
+
9
+ ### Patch Changes
10
+
11
+ - 195411c: patch dependencies
12
+ - f5ba3aa: Allow-list Atlassian media URLs by default for media CSP policies
13
+
14
+ ## 4.0.1-next.1
15
+
16
+ ### Patch Changes
17
+
18
+ - f5ba3aa: Allow-list Atlassian media URLs by default for media CSP policies
19
+
3
20
  ## 4.0.1-next.0
4
21
 
5
22
  ### 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;AA2DvD,eAAO,MAAM,sBAAsB,EAAE;KAAG,SAAS,IAAI,iBAAiB,GAAG,MAAM,EAAE;CA8ChF,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,iBAAiB;IAoClB,gBAAgB;4BAOD,UAAU;mBACnB,iBAAiB;;;;UAI1B,MAAM,EAAE,CA6DV;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;AA2DvD,eAAO,MAAM,sBAAsB,EAAE;KAAG,SAAS,IAAI,iBAAiB,GAAG,MAAM,EAAE;CA8ChF,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,iBAAiB;IAoClB,gBAAgB;4BAOD,UAAU;mBACnB,iBAAiB;;;;UAI1B,MAAM,EAAE,CA8DV;CACH"}
@@ -172,6 +172,7 @@ class CSPInjectionService {
172
172
  'data:',
173
173
  'blob:',
174
174
  hostname,
175
+ ATLASSIAN_MEDIA_GATEWAY_HOST[microsEnv],
175
176
  ...this.getExistingCSPDetails(types_1.ExternalCspType.MEDIA_SRC, existingCSPDetails)
176
177
  ]
177
178
  .filter((a) => a)
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CSPProcessingService = exports.InvalidConnectSrc = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const cheerio_1 = tslib_1.__importDefault(require("cheerio"));
5
+ const cheerio_1 = require("cheerio");
6
6
  const content_security_policy_parser_1 = tslib_1.__importDefault(require("content-security-policy-parser"));
7
7
  const crypto_1 = tslib_1.__importDefault(require("crypto"));
8
8
  class InvalidConnectSrc extends Error {
@@ -28,7 +28,7 @@ class CSPProcessingService {
28
28
  getCspDetails(body, permissions) {
29
29
  const { scripts, styles } = permissions?.content ?? { scripts: [], styles: [] };
30
30
  const external = permissions?.external ?? {};
31
- const $ = cheerio_1.default.load(body);
31
+ const $ = (0, cheerio_1.load)(body, { xml: { xmlMode: false } });
32
32
  const { 'script-src': scriptSrc, 'style-src': styleSrc, ...mappedExternalCsp } = this.mapExternalPermissionsToCsp(external);
33
33
  return {
34
34
  'style-src': [...this.getStyleSrc($, styles), ...styleSrc],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "4.0.1-next.0",
3
+ "version": "4.0.1-next.1-experimental-effab31",
4
4
  "description": "Contains the CSP configuration for Custom UI resources in Forge",
5
5
  "main": "out/index.js",
6
6
  "author": "Atlassian",
@@ -11,13 +11,13 @@
11
11
  "clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
12
12
  },
13
13
  "devDependencies": {
14
- "@forge/cli-shared": "8.0.1-next.4",
15
- "@forge/manifest": "10.0.1-next.4",
14
+ "@forge/cli-shared": "8.1.0-next.7-experimental-effab31",
15
+ "@forge/manifest": "10.0.1-next.7-experimental-effab31",
16
16
  "@types/jest": "^29.5.14",
17
17
  "@types/node": "20.19.1"
18
18
  },
19
19
  "dependencies": {
20
- "cheerio": "^0.22.0",
20
+ "cheerio": "^1.1.0",
21
21
  "content-security-policy-parser": "^0.4.1"
22
22
  },
23
23
  "publishConfig": {