@forge/csp 3.5.0-next.0 → 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,11 @@
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
+
3
9
  ## 3.5.0-next.0
4
10
 
5
11
  ### 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;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,60 +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 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_IMAGES_HOSTS = {
27
27
  dev: [
28
- `https://${atlassianAvatarHost['dev']}`,
29
- `https://*.wp.com/${atlassianAvatarHost['dev']}/`,
30
- apiGatewayHost['dev'],
31
- mediaGatewayHost['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']
32
32
  ],
33
33
  stg: [
34
- `https://${atlassianAvatarHost['stg']}`,
35
- `https://*.wp.com/${atlassianAvatarHost['stg']}/`,
36
- apiGatewayHost['stg'],
37
- mediaGatewayHost['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']
38
38
  ],
39
39
  prod: [
40
- `https://${atlassianAvatarHost['prod']}`,
41
- `https://*.wp.com/${atlassianAvatarHost['prod']}/`,
42
- apiGatewayHost['prod'],
43
- mediaGatewayHost['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']
44
44
  ],
45
45
  'fedramp-stg': [
46
- `https://${atlassianAvatarHost['fedramp-stg']}`,
47
- `https://*.wp.com/${atlassianAvatarHost['fedramp-stg']}/`,
48
- apiGatewayHost['fedramp-stg'],
49
- mediaGatewayHost['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']
50
50
  ],
51
51
  'fedramp-prod': [
52
- `https://${atlassianAvatarHost['fedramp-prod']}`,
53
- `https://*.wp.com/${atlassianAvatarHost['fedramp-prod']}/`,
54
- apiGatewayHost['fedramp-prod'],
55
- mediaGatewayHost['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']
56
56
  ]
57
57
  };
58
- const gravatarUrl = 'https://secure.gravatar.com';
58
+ const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
59
59
  class CSPInjectionService {
60
60
  getCSPReportUri(microsEnv) {
61
61
  if (microsEnv === 'dev' || microsEnv === 'stg')
@@ -118,8 +118,8 @@ class CSPInjectionService {
118
118
  'data:',
119
119
  'blob:',
120
120
  hostname,
121
- gravatarUrl,
122
- ...atlassianImageHosts[microsEnv],
121
+ ...EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
122
+ ...ATLASSIAN_IMAGES_HOSTS[microsEnv],
123
123
  ...this.getExistingCSPDetails(types_1.ExternalCspType.IMG_SRC, existingCSPDetails)
124
124
  ]
125
125
  .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.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,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.4",
15
15
  "@forge/manifest": "8.2.1-next.2",
16
16
  "@types/jest": "^29.5.12",
17
17
  "@types/node": "14.18.63"