@forge/csp 6.3.3-next.0 → 6.4.0
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,21 @@
|
|
|
1
1
|
# @forge/csp
|
|
2
2
|
|
|
3
|
+
## 6.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4dd1a11: Add stg-gcentral as env and setup forge csp for gcp service urls
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 5a91774: Updated test tooling to Jest 30, migrated test matchers and snapshot headers, and added coverage for translation caching and permission ordering. Removed a redundant private validation guard while preserving the public validation checks.
|
|
12
|
+
|
|
13
|
+
## 6.4.0-next.1
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 4dd1a11: Add stg-gcentral as env and setup forge csp for gcp service urls
|
|
18
|
+
|
|
3
19
|
## 6.3.3-next.0
|
|
4
20
|
|
|
5
21
|
### 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;AAEvD,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,KAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;
|
|
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;AAEvD,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,KAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAuO1D,eAAO,MAAM,qBAAqB,GAAI,WAAW,iBAAiB,EAAE,YAAY,SAAS,KAAG,MAAM,EAcjG,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IAoCrB,OAAO,CAAC,iBAAiB;IA6ElB,gBAAgB,GAAI,2JAUxB;QACD,kBAAkB,EAAE,UAAU,CAAC;QAC/B,SAAS,EAAE,iBAAiB,CAAC;QAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC,KAAG,MAAM,EAAE,CAsGV;CACH"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CSPInjectionService = exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = exports.getAtlassianImageHost = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const isICEnvKey = (env) => env === 'ic-prod' || env === 'ic-stg';
|
|
6
|
+
const isGCPEnvKey = (env) => env.endsWith('-gcentral');
|
|
6
7
|
const makeICDomain = (env, icLabel) => `${icLabel}.${env === 'ic-prod' ? 'atlassian-isolated.net' : 'oasis-stg.com'}`;
|
|
7
8
|
const getICDomain = (env, icOptions) => {
|
|
8
9
|
if ('getICDomain' in icOptions) {
|
|
@@ -23,7 +24,8 @@ const ATLASSIAN_HOST = {
|
|
|
23
24
|
prod: 'https://api.atlassian.com',
|
|
24
25
|
'fedramp-stg': 'https://api.stg.atlassian-us-gov-mod.com',
|
|
25
26
|
'fedramp-prod': 'https://api.atlassian-us-gov-mod.com',
|
|
26
|
-
...makeICHosts((env, icOptions) => `https://api.${getICDomain(env, icOptions)}`)
|
|
27
|
+
...makeICHosts((env, icOptions) => `https://api.${getICDomain(env, icOptions)}`),
|
|
28
|
+
'stg-gcentral': 'https://api.stg.atlassian.com'
|
|
27
29
|
},
|
|
28
30
|
ATLASSIAN_MEDIA_GATEWAY_HOST: {
|
|
29
31
|
dev: 'https://media.dev.atl-paas.net',
|
|
@@ -31,7 +33,8 @@ const ATLASSIAN_HOST = {
|
|
|
31
33
|
prod: 'https://api.media.atlassian.com',
|
|
32
34
|
'fedramp-stg': 'https://api-media.stg.atlassian-us-gov-mod.com',
|
|
33
35
|
'fedramp-prod': 'https://api-media.atlassian-us-gov-mod.com',
|
|
34
|
-
...makeICHosts((env, icOptions) => `https://media-api.${getICDomain(env, icOptions)}`)
|
|
36
|
+
...makeICHosts((env, icOptions) => `https://media-api.${getICDomain(env, icOptions)}`),
|
|
37
|
+
'stg-gcentral': ''
|
|
35
38
|
},
|
|
36
39
|
ATLASSIAN_ASSETS_MEDIA_HOST: {
|
|
37
40
|
dev: 'https://assets-media.stg.atlassian.com',
|
|
@@ -39,7 +42,8 @@ const ATLASSIAN_HOST = {
|
|
|
39
42
|
prod: 'https://assets-media.atlassian.com',
|
|
40
43
|
'fedramp-stg': 'https://assets-media.stg.atlassian-us-gov-mod.com',
|
|
41
44
|
'fedramp-prod': 'https://assets-media.atlassian-us-gov-mod.com',
|
|
42
|
-
...makeICHosts((env, icOptions) => `https://assets-media.${getICDomain(env, icOptions)}`)
|
|
45
|
+
...makeICHosts((env, icOptions) => `https://assets-media.${getICDomain(env, icOptions)}`),
|
|
46
|
+
'stg-gcentral': ''
|
|
43
47
|
},
|
|
44
48
|
ATLASSIAN_ANALYTICS_GATEWAY_HOST: {
|
|
45
49
|
dev: 'https://as.dev.atl-paas.net',
|
|
@@ -47,7 +51,8 @@ const ATLASSIAN_HOST = {
|
|
|
47
51
|
prod: 'https://as.atlassian.com',
|
|
48
52
|
'fedramp-stg': 'https://as.stg.atlassian-us-gov-mod.com',
|
|
49
53
|
'fedramp-prod': 'https://as.atlassian-us-gov-mod.com',
|
|
50
|
-
...makeICHosts((env, icOptions) => `https://as.${getICDomain(env, icOptions)}`)
|
|
54
|
+
...makeICHosts((env, icOptions) => `https://as.${getICDomain(env, icOptions)}`),
|
|
55
|
+
'stg-gcentral': 'https://as.staging.atl-paas.net'
|
|
51
56
|
},
|
|
52
57
|
ATLASSIAN_AVATAR_HOST: {
|
|
53
58
|
dev: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
|
|
@@ -55,7 +60,8 @@ const ATLASSIAN_HOST = {
|
|
|
55
60
|
prod: 'avatar-management--avatars.us-west-2.prod.public.atl-paas.net',
|
|
56
61
|
'fedramp-stg': 'avatar-management--avatars.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
|
|
57
62
|
'fedramp-prod': 'avatar-management--avatars.us-east-1.prod.cdn.atlassian-us-gov-mod.com',
|
|
58
|
-
...makeICHosts((env, icOptions) => `avatar-management.services.${getICDomain(env, icOptions)}`)
|
|
63
|
+
...makeICHosts((env, icOptions) => `avatar-management.services.${getICDomain(env, icOptions)}`),
|
|
64
|
+
'stg-gcentral': 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net'
|
|
59
65
|
},
|
|
60
66
|
ATLASSIAN_TEAM_HEADER_HOST: {
|
|
61
67
|
dev: 'https://teams-directory-frontend.stg-east.frontend.public.atl-paas.net/assets/gradients/',
|
|
@@ -63,7 +69,8 @@ const ATLASSIAN_HOST = {
|
|
|
63
69
|
prod: 'https://teams-directory-frontend.prod-east.frontend.public.atl-paas.net/assets/gradients/',
|
|
64
70
|
'fedramp-stg': 'https://teams-directory-frontend.frontend.cdn.atlassian-us-gov-mod.com/assets/',
|
|
65
71
|
'fedramp-prod': 'https://teams-directory-frontend.frontend.cdn.atlassian-us-gov-mod.com/assets/',
|
|
66
|
-
...makeICHosts((env, icOptions) => `https://teams-directory-frontend.services.${getICDomain(env, icOptions)}/bfa/`)
|
|
72
|
+
...makeICHosts((env, icOptions) => `https://teams-directory-frontend.services.${getICDomain(env, icOptions)}/bfa/`),
|
|
73
|
+
'stg-gcentral': 'https://teams-directory-frontend.stg-east.frontend.public.atl-paas.net/assets/'
|
|
67
74
|
},
|
|
68
75
|
ATLASSIAN_TEAM_AVATAR_HOST: {
|
|
69
76
|
dev: 'https://teams-directory-frontend.stg-east.frontend.public.atl-paas.net/assets/',
|
|
@@ -71,7 +78,8 @@ const ATLASSIAN_HOST = {
|
|
|
71
78
|
prod: 'https://teams-directory-frontend.prod-east.frontend.public.atl-paas.net/assets/',
|
|
72
79
|
'fedramp-stg': 'https://teams-directory-frontend.frontend.cdn.atlassian-us-gov-mod.com/assets/',
|
|
73
80
|
'fedramp-prod': 'https://teams-directory-frontend.frontend.cdn.atlassian-us-gov-mod.com/assets/',
|
|
74
|
-
...makeICHosts((env, icOptions) => `https://teams-directory-frontend.services.${getICDomain(env, icOptions)}/bfa/`)
|
|
81
|
+
...makeICHosts((env, icOptions) => `https://teams-directory-frontend.services.${getICDomain(env, icOptions)}/bfa/`),
|
|
82
|
+
'stg-gcentral': 'https://teams-directory-frontend.stg-east.frontend.public.atl-paas.net/assets/'
|
|
75
83
|
},
|
|
76
84
|
ATLASSIAN_EMOJIS_HOST: {
|
|
77
85
|
dev: 'https://pf-emoji-service.ddev.frontend.public.atl-paas.net',
|
|
@@ -79,7 +87,8 @@ const ATLASSIAN_HOST = {
|
|
|
79
87
|
prod: 'https://pf-emoji-service.prod-east.frontend.public.atl-paas.net',
|
|
80
88
|
'fedramp-stg': 'https://pf-emoji-service.frontend.staging.cdn.atlassian-us-gov-mod.com',
|
|
81
89
|
'fedramp-prod': 'https://pf-emoji-service.frontend.cdn.atlassian-us-gov-mod.com',
|
|
82
|
-
...makeICHosts((env, icOptions) => `https://pf-emoji-service.${getICDomain(env, icOptions)}/bfa/emoji-service/`)
|
|
90
|
+
...makeICHosts((env, icOptions) => `https://pf-emoji-service.${getICDomain(env, icOptions)}/bfa/emoji-service/`),
|
|
91
|
+
'stg-gcentral': ''
|
|
83
92
|
},
|
|
84
93
|
ATLASSIAN_REACTIONS_HOST: {
|
|
85
94
|
dev: 'https://pf-reactions-service.ddev.frontend.public.atl-paas.net',
|
|
@@ -87,7 +96,8 @@ const ATLASSIAN_HOST = {
|
|
|
87
96
|
prod: 'https://pf-reactions-service.prod-east.frontend.public.atl-paas.net',
|
|
88
97
|
'fedramp-stg': 'https://pf-reactions-service.frontend.staging.cdn.atlassian-us-gov-mod.com',
|
|
89
98
|
'fedramp-prod': 'https://pf-reactions-service.frontend.cdn.atlassian-us-gov-mod.com',
|
|
90
|
-
...makeICHosts((env, icOptions) => `https://pf-reactions-service.services.${getICDomain(env, icOptions)}/bfa/reactions-service/`)
|
|
99
|
+
...makeICHosts((env, icOptions) => `https://pf-reactions-service.services.${getICDomain(env, icOptions)}/bfa/reactions-service/`),
|
|
100
|
+
'stg-gcentral': ''
|
|
91
101
|
},
|
|
92
102
|
ATLASSIAN_FOP_GE_HOST: {
|
|
93
103
|
dev: 'https://forge-outbound-proxy.dev.services.atlassian.com',
|
|
@@ -95,7 +105,8 @@ const ATLASSIAN_HOST = {
|
|
|
95
105
|
prod: 'https://forge-outbound-proxy.services.atlassian.com',
|
|
96
106
|
'fedramp-stg': '',
|
|
97
107
|
'fedramp-prod': '',
|
|
98
|
-
...makeICHosts((env, icOptions) => '')
|
|
108
|
+
...makeICHosts((env, icOptions) => ''),
|
|
109
|
+
'stg-gcentral': ''
|
|
99
110
|
},
|
|
100
111
|
ATLASSIAN_FOS_HOST: {
|
|
101
112
|
dev: 'https://tdp-os.dev.services.atlassian.com',
|
|
@@ -103,7 +114,8 @@ const ATLASSIAN_HOST = {
|
|
|
103
114
|
prod: 'https://tdp-os.services.atlassian.com',
|
|
104
115
|
'fedramp-stg': 'https://tdp-os.stg.services.atlassian-us-gov-mod.com',
|
|
105
116
|
'fedramp-prod': 'https://tdp-os.services.atlassian-us-gov-mod.com',
|
|
106
|
-
...makeICHosts((env, icOptions) => `https://tdp-os.services.${getICDomain(env, icOptions)}`)
|
|
117
|
+
...makeICHosts((env, icOptions) => `https://tdp-os.services.${getICDomain(env, icOptions)}`),
|
|
118
|
+
'stg-gcentral': 'https://tdp-os.stg.services.atlassian.com'
|
|
107
119
|
}
|
|
108
120
|
};
|
|
109
121
|
const getAtlassianHost = (hostType, microsEnv, icOptions) => {
|
|
@@ -119,7 +131,11 @@ const getAtlassianHost = (hostType, microsEnv, icOptions) => {
|
|
|
119
131
|
const FOS_CDN_STANDARD_HOST = {
|
|
120
132
|
dev: 'https://object-store.stg.atlassian.com',
|
|
121
133
|
stg: 'https://object-store.stg.atlassian.com',
|
|
122
|
-
prod: 'https://object-store.atlassian.com'
|
|
134
|
+
prod: 'https://object-store.atlassian.com',
|
|
135
|
+
'stg-gcentral': 'https://object-store.stg.atlassian.com'
|
|
136
|
+
};
|
|
137
|
+
const GCP_FORGE_CDN_HOST = {
|
|
138
|
+
'stg-gcentral': 'https://forge.cdn.stg.atlassian-dev.net'
|
|
123
139
|
};
|
|
124
140
|
const FOS_CDN_IC_HOST = makeICHosts((env, icOptions) => `https://object-store.${getICDomain(env, icOptions)}`);
|
|
125
141
|
const FOS_CDN_PATH = '/os/ecosystem/installation/';
|
|
@@ -131,15 +147,11 @@ const getFOSCDNHost = (microsEnv, icOptions) => {
|
|
|
131
147
|
};
|
|
132
148
|
const getFOSHostDownload = (microsEnv, icOptions) => {
|
|
133
149
|
const fosHost = getAtlassianHost('ATLASSIAN_FOS_HOST', microsEnv, icOptions);
|
|
134
|
-
return
|
|
135
|
-
? [`${fosHost}/fos/app/download/`, `${fosHost}/fos/cdn/download/`]
|
|
136
|
-
: [`${fosHost}/fos-eap/download/`, `${fosHost}/fos/app/download/`, `${fosHost}/fos/cdn/download/`];
|
|
150
|
+
return [`${fosHost}/fos/app/download/`, `${fosHost}/fos/cdn/download/`];
|
|
137
151
|
};
|
|
138
152
|
const getFOSHostUpload = (microsEnv, icOptions) => {
|
|
139
153
|
const fosHost = getAtlassianHost('ATLASSIAN_FOS_HOST', microsEnv, icOptions);
|
|
140
|
-
return
|
|
141
|
-
? [`${fosHost}/fos/app/upload/`, `${fosHost}/fos/cdn/upload/`]
|
|
142
|
-
: [`${fosHost}/fos-eap/upload/`, `${fosHost}/fos/app/upload/`, `${fosHost}/fos/cdn/upload/`];
|
|
154
|
+
return [`${fosHost}/fos/app/upload/`, `${fosHost}/fos/cdn/upload/`];
|
|
143
155
|
};
|
|
144
156
|
const getFOSCDNUrls = (microsEnv, icOptions) => {
|
|
145
157
|
const fosCDNHost = getFOSCDNHost(microsEnv, icOptions);
|
|
@@ -261,7 +273,7 @@ class CSPInjectionService {
|
|
|
261
273
|
}
|
|
262
274
|
getCSPReportUri(microsEnv, icOptions) {
|
|
263
275
|
const serviceName = isICEnvKey(microsEnv) && icOptions ? icOptions.serviceName : 'forge-cdn';
|
|
264
|
-
if (microsEnv === 'dev' || microsEnv === 'stg')
|
|
276
|
+
if (microsEnv === 'dev' || microsEnv === 'stg' || microsEnv === 'stg-gcentral')
|
|
265
277
|
return `https://web-security-reports.stg.services.atlassian.com/csp-report/${serviceName}`;
|
|
266
278
|
return `https://web-security-reports.services.atlassian.com/csp-report/${serviceName}`;
|
|
267
279
|
}
|
|
@@ -269,6 +281,9 @@ class CSPInjectionService {
|
|
|
269
281
|
if (isICEnvKey(microsEnv) && icOptions) {
|
|
270
282
|
return `https://forge.forge-cdn.${getICDomain(microsEnv, icOptions)}`;
|
|
271
283
|
}
|
|
284
|
+
if (isGCPEnvKey(microsEnv)) {
|
|
285
|
+
return GCP_FORGE_CDN_HOST[microsEnv];
|
|
286
|
+
}
|
|
272
287
|
return isFedRAMP
|
|
273
288
|
? `https://forge.cdn.${microsEnv.split('-')[1]}.atlassian-dev-us-gov-mod.net`
|
|
274
289
|
: `https://forge.cdn.${microsEnv}.atlassian-dev.net`;
|
|
@@ -309,6 +324,7 @@ class CSPInjectionService {
|
|
|
309
324
|
switch (microsEnv) {
|
|
310
325
|
case 'dev':
|
|
311
326
|
case 'stg':
|
|
327
|
+
case 'stg-gcentral':
|
|
312
328
|
frameAncestors = [
|
|
313
329
|
'*.jira-dev.com',
|
|
314
330
|
'http://localhost:*',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
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": "9.
|
|
15
|
-
"@forge/manifest": "13.
|
|
14
|
+
"@forge/cli-shared": "9.9.0",
|
|
15
|
+
"@forge/manifest": "13.8.0",
|
|
16
16
|
"@types/jest": "^30.0.0",
|
|
17
17
|
"@types/node": "20.19.1",
|
|
18
18
|
"cheerio": "^1.2.0",
|