@forge/csp 3.5.0-next.0 → 3.5.0-next.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
+ ## 3.5.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 02c5edf: Allow listing the emojis CDN for image CSPs
8
+
9
+ ## 3.5.0-next.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 8724df7: Allowing by default the images sourced from Unsplash website for Custom UI apps
14
+
3
15
  ## 3.5.0-next.0
4
16
 
5
17
  ### Minor 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;AAsEvD,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;AAuFvD,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,60 +2,72 @@
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 mediaGatewayHost = {
12
+ const ATLASSIAN_MEDIA_GATEWAY_HOST = {
13
13
  dev: 'https://media.dev.atl-paas.net',
14
14
  stg: 'https://media.staging.atl-paas.net',
15
15
  prod: 'https://api.media.atlassian.com',
16
16
  'fedramp-stg': 'https://api-media.stg.atlassian-us-gov-mod.com',
17
17
  'fedramp-prod': 'https://api-media.atlassian-us-gov-mod.com'
18
18
  };
19
- const atlassianAvatarHost = {
19
+ const ATLASSIAN_AVATAR_HOST = {
20
20
  dev: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
21
21
  stg: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
22
22
  prod: 'avatar-management--avatars.us-west-2.prod.public.atl-paas.net',
23
23
  'fedramp-stg': 'avatar-management--avatars.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
24
24
  'fedramp-prod': 'avatar-management--avatars.us-east-1.prod.cdn.atlassian-us-gov-mod.com'
25
25
  };
26
- const atlassianImageHosts = {
26
+ const ATLASSIAN_EMOJIS_HOST = {
27
+ dev: 'https://pf-emoji-service--cdn.ap-southeast-2.dev.public.atl-paas.net',
28
+ stg: 'https://pf-emoji-service--cdn.us-east-1.staging.public.atl-paas.net',
29
+ prod: 'https://pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net',
30
+ 'fedramp-stg': 'https://pf-emoji-service--cdn.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
31
+ 'fedramp-prod': 'https://pf-emoji-service--cdn.us-east-1.prod.cdn.atlassian-us-gov-mod.com'
32
+ };
33
+ const ATLASSIAN_IMAGES_HOSTS = {
27
34
  dev: [
28
- `https://${atlassianAvatarHost['dev']}`,
29
- `https://*.wp.com/${atlassianAvatarHost['dev']}/`,
30
- apiGatewayHost['dev'],
31
- mediaGatewayHost['dev']
35
+ `https://${ATLASSIAN_AVATAR_HOST['dev']}`,
36
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['dev']}/`,
37
+ ATLASSIAN_API_GATEWAY_HOST['dev'],
38
+ ATLASSIAN_MEDIA_GATEWAY_HOST['dev'],
39
+ ATLASSIAN_EMOJIS_HOST['dev']
32
40
  ],
33
41
  stg: [
34
- `https://${atlassianAvatarHost['stg']}`,
35
- `https://*.wp.com/${atlassianAvatarHost['stg']}/`,
36
- apiGatewayHost['stg'],
37
- mediaGatewayHost['stg']
42
+ `https://${ATLASSIAN_AVATAR_HOST['stg']}`,
43
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['stg']}/`,
44
+ ATLASSIAN_API_GATEWAY_HOST['stg'],
45
+ ATLASSIAN_MEDIA_GATEWAY_HOST['stg'],
46
+ ATLASSIAN_EMOJIS_HOST['stg']
38
47
  ],
39
48
  prod: [
40
- `https://${atlassianAvatarHost['prod']}`,
41
- `https://*.wp.com/${atlassianAvatarHost['prod']}/`,
42
- apiGatewayHost['prod'],
43
- mediaGatewayHost['prod']
49
+ `https://${ATLASSIAN_AVATAR_HOST['prod']}`,
50
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['prod']}/`,
51
+ ATLASSIAN_API_GATEWAY_HOST['prod'],
52
+ ATLASSIAN_MEDIA_GATEWAY_HOST['prod'],
53
+ ATLASSIAN_EMOJIS_HOST['prod']
44
54
  ],
45
55
  'fedramp-stg': [
46
- `https://${atlassianAvatarHost['fedramp-stg']}`,
47
- `https://*.wp.com/${atlassianAvatarHost['fedramp-stg']}/`,
48
- apiGatewayHost['fedramp-stg'],
49
- mediaGatewayHost['fedramp-stg']
56
+ `https://${ATLASSIAN_AVATAR_HOST['fedramp-stg']}`,
57
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['fedramp-stg']}/`,
58
+ ATLASSIAN_API_GATEWAY_HOST['fedramp-stg'],
59
+ ATLASSIAN_MEDIA_GATEWAY_HOST['fedramp-stg'],
60
+ ATLASSIAN_EMOJIS_HOST['fedramp-stg']
50
61
  ],
51
62
  'fedramp-prod': [
52
- `https://${atlassianAvatarHost['fedramp-prod']}`,
53
- `https://*.wp.com/${atlassianAvatarHost['fedramp-prod']}/`,
54
- apiGatewayHost['fedramp-prod'],
55
- mediaGatewayHost['fedramp-prod']
63
+ `https://${ATLASSIAN_AVATAR_HOST['fedramp-prod']}`,
64
+ `https://*.wp.com/${ATLASSIAN_AVATAR_HOST['fedramp-prod']}/`,
65
+ ATLASSIAN_API_GATEWAY_HOST['fedramp-prod'],
66
+ ATLASSIAN_MEDIA_GATEWAY_HOST['fedramp-prod'],
67
+ ATLASSIAN_EMOJIS_HOST['fedramp-prod']
56
68
  ]
57
69
  };
58
- const gravatarUrl = 'https://secure.gravatar.com';
70
+ const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
59
71
  class CSPInjectionService {
60
72
  getCSPReportUri(microsEnv) {
61
73
  if (microsEnv === 'dev' || microsEnv === 'stg')
@@ -118,8 +130,8 @@ class CSPInjectionService {
118
130
  'data:',
119
131
  'blob:',
120
132
  hostname,
121
- gravatarUrl,
122
- ...atlassianImageHosts[microsEnv],
133
+ ...EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
134
+ ...ATLASSIAN_IMAGES_HOSTS[microsEnv],
123
135
  ...this.getExistingCSPDetails(types_1.ExternalCspType.IMG_SRC, existingCSPDetails)
124
136
  ]
125
137
  .filter((a) => a)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "3.5.0-next.0",
3
+ "version": "3.5.0-next.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,7 +11,7 @@
11
11
  "clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
12
12
  },
13
13
  "devDependencies": {
14
- "@forge/cli-shared": "6.4.2-next.3",
14
+ "@forge/cli-shared": "6.5.0-next.5",
15
15
  "@forge/manifest": "8.2.1-next.2",
16
16
  "@types/jest": "^29.5.12",
17
17
  "@types/node": "14.18.63"