@forge/csp 3.4.1 → 3.5.0-next.1

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
+ ## 3.5.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8724df7: Allowing by default the images sourced from Unsplash website for Custom UI apps
8
+
9
+ ## 3.5.0-next.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 540ea27: Allow listing the media API for image CSPs
14
+
3
15
  ## 3.4.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;AAqDvD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IA8BlB,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;AA0EvD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IA8BlB,gBAAgB;4BAOD,UAAU;mBACnB,iBAAiB;;;;UAI1B,MAAM,EAAE,CA6DV;CACH"}
@@ -2,48 +2,60 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CSPInjectionService = void 0;
4
4
  const types_1 = require("../types");
5
- const apiGatewayHost = {
5
+ const ATLASSIAN_API_GATEWAY_HOST = {
6
6
  dev: 'https://api.dev.atlassian.com',
7
7
  stg: 'https://api.stg.atlassian.com',
8
8
  prod: 'https://api.atlassian.com',
9
9
  'fedramp-stg': 'https://api.stg.atlassian-us-gov-mod.com',
10
10
  'fedramp-prod': 'https://api.atlassian-us-gov-mod.com'
11
11
  };
12
- const atlassianAvatarHost = {
12
+ const ATLASSIAN_MEDIA_GATEWAY_HOST = {
13
+ dev: 'https://media.dev.atl-paas.net',
14
+ stg: 'https://media.staging.atl-paas.net',
15
+ prod: 'https://api.media.atlassian.com',
16
+ 'fedramp-stg': 'https://api-media.stg.atlassian-us-gov-mod.com',
17
+ 'fedramp-prod': 'https://api-media.atlassian-us-gov-mod.com'
18
+ };
19
+ const ATLASSIAN_AVATAR_HOST = {
13
20
  dev: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
14
21
  stg: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
15
22
  prod: 'avatar-management--avatars.us-west-2.prod.public.atl-paas.net',
16
23
  'fedramp-stg': 'avatar-management--avatars.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
17
24
  'fedramp-prod': 'avatar-management--avatars.us-east-1.prod.cdn.atlassian-us-gov-mod.com'
18
25
  };
19
- const atlassianImageHosts = {
26
+ const ATLASSIAN_IMAGES_HOSTS = {
20
27
  dev: [
21
- `https://${atlassianAvatarHost['dev']}`,
22
- `https://*.wp.com/${atlassianAvatarHost['dev']}/`,
23
- apiGatewayHost['dev']
28
+ `https://${ATLASSIAN_AVATAR_HOST['dev']}`,
29
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['dev']}/`,
30
+ ATLASSIAN_API_GATEWAY_HOST['dev'],
31
+ ATLASSIAN_MEDIA_GATEWAY_HOST['dev']
24
32
  ],
25
33
  stg: [
26
- `https://${atlassianAvatarHost['stg']}`,
27
- `https://*.wp.com/${atlassianAvatarHost['stg']}/`,
28
- apiGatewayHost['stg']
34
+ `https://${ATLASSIAN_AVATAR_HOST['stg']}`,
35
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['stg']}/`,
36
+ ATLASSIAN_API_GATEWAY_HOST['stg'],
37
+ ATLASSIAN_MEDIA_GATEWAY_HOST['stg']
29
38
  ],
30
39
  prod: [
31
- `https://${atlassianAvatarHost['prod']}`,
32
- `https://*.wp.com/${atlassianAvatarHost['prod']}/`,
33
- apiGatewayHost['prod']
40
+ `https://${ATLASSIAN_AVATAR_HOST['prod']}`,
41
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['prod']}/`,
42
+ ATLASSIAN_API_GATEWAY_HOST['prod'],
43
+ ATLASSIAN_MEDIA_GATEWAY_HOST['prod']
34
44
  ],
35
45
  'fedramp-stg': [
36
- `https://${atlassianAvatarHost['fedramp-stg']}`,
37
- `https://*.wp.com/${atlassianAvatarHost['fedramp-stg']}/`,
38
- apiGatewayHost['fedramp-stg']
46
+ `https://${ATLASSIAN_AVATAR_HOST['fedramp-stg']}`,
47
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['fedramp-stg']}/`,
48
+ ATLASSIAN_API_GATEWAY_HOST['fedramp-stg'],
49
+ ATLASSIAN_MEDIA_GATEWAY_HOST['fedramp-stg']
39
50
  ],
40
51
  'fedramp-prod': [
41
- `https://${atlassianAvatarHost['fedramp-prod']}`,
42
- `https://*.wp.com/${atlassianAvatarHost['fedramp-prod']}/`,
43
- apiGatewayHost['fedramp-prod']
52
+ `https://${ATLASSIAN_AVATAR_HOST['fedramp-prod']}`,
53
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['fedramp-prod']}/`,
54
+ ATLASSIAN_API_GATEWAY_HOST['fedramp-prod'],
55
+ ATLASSIAN_MEDIA_GATEWAY_HOST['fedramp-prod']
44
56
  ]
45
57
  };
46
- const gravatarUrl = 'https://secure.gravatar.com';
58
+ const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
47
59
  class CSPInjectionService {
48
60
  getCSPReportUri(microsEnv) {
49
61
  if (microsEnv === 'dev' || microsEnv === 'stg')
@@ -106,8 +118,8 @@ class CSPInjectionService {
106
118
  'data:',
107
119
  'blob:',
108
120
  hostname,
109
- gravatarUrl,
110
- ...atlassianImageHosts[microsEnv],
121
+ ...EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
122
+ ...ATLASSIAN_IMAGES_HOSTS[microsEnv],
111
123
  ...this.getExistingCSPDetails(types_1.ExternalCspType.IMG_SRC, existingCSPDetails)
112
124
  ]
113
125
  .filter((a) => a)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "3.4.1",
3
+ "version": "3.5.0-next.1",
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": "6.4.1",
15
- "@forge/manifest": "8.2.0",
14
+ "@forge/cli-shared": "6.5.0-next.4",
15
+ "@forge/manifest": "8.2.1-next.2",
16
16
  "@types/jest": "^29.5.12",
17
17
  "@types/node": "14.18.63"
18
18
  },