@forge/csp 3.3.0 → 3.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,17 @@
|
|
|
1
1
|
# @forge/csp
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4fa9673: Update CSP policies to remove the need for customer defined egress for loading avatar images & host media access
|
|
8
|
+
|
|
9
|
+
## 3.4.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 4fa9673: Update CSP policies to remove the need for customer defined egress for loading avatar images & host media access
|
|
14
|
+
|
|
3
15
|
## 3.3.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;
|
|
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,CA+DV;CACH"}
|
|
@@ -9,16 +9,37 @@ const apiGatewayHost = {
|
|
|
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 = {
|
|
13
|
+
dev: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
|
|
14
|
+
stg: 'avatar-management--avatars.us-west-2.staging.public.atl-paas.net',
|
|
15
|
+
prod: 'avatar-management--avatars.us-west-2.prod.public.atl-paas.net',
|
|
16
|
+
'fedramp-stg': 'avatar-management--avatars.us-east-1.staging.cdn.atlassian-us-gov-mod.com',
|
|
17
|
+
'fedramp-prod': 'avatar-management--avatars.us-east-1.prod.cdn.atlassian-us-gov-mod.com'
|
|
18
|
+
};
|
|
12
19
|
const atlassianImageHosts = {
|
|
13
|
-
dev: [
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
dev: [
|
|
21
|
+
`https://${atlassianAvatarHost['dev']}`,
|
|
22
|
+
`https://*.wp.com/${atlassianAvatarHost['dev']}/`,
|
|
23
|
+
apiGatewayHost['dev']
|
|
24
|
+
],
|
|
25
|
+
stg: [
|
|
26
|
+
`https://${atlassianAvatarHost['stg']}`,
|
|
27
|
+
`https://*.wp.com/${atlassianAvatarHost['stg']}/`,
|
|
28
|
+
apiGatewayHost['stg']
|
|
29
|
+
],
|
|
30
|
+
prod: [
|
|
31
|
+
`https://${atlassianAvatarHost['prod']}`,
|
|
32
|
+
`https://*.wp.com/${atlassianAvatarHost['prod']}/`,
|
|
33
|
+
apiGatewayHost['prod']
|
|
34
|
+
],
|
|
16
35
|
'fedramp-stg': [
|
|
17
|
-
'
|
|
36
|
+
`https://${atlassianAvatarHost['fedramp-stg']}`,
|
|
37
|
+
`https://*.wp.com/${atlassianAvatarHost['fedramp-stg']}/`,
|
|
18
38
|
apiGatewayHost['fedramp-stg']
|
|
19
39
|
],
|
|
20
40
|
'fedramp-prod': [
|
|
21
|
-
'
|
|
41
|
+
`https://${atlassianAvatarHost['fedramp-prod']}`,
|
|
42
|
+
`https://*.wp.com/${atlassianAvatarHost['fedramp-prod']}/`,
|
|
22
43
|
apiGatewayHost['fedramp-prod']
|
|
23
44
|
]
|
|
24
45
|
};
|
|
@@ -76,7 +97,9 @@ class CSPInjectionService {
|
|
|
76
97
|
const reportUri = tunnelCSPReporterUri || this.getCSPReportUri(microsEnv);
|
|
77
98
|
const defaultSrc = `'self'`;
|
|
78
99
|
const frameAncestors = ["'self'", ...this.getFrameAncestors(microsEnv, hostname)].join(' ');
|
|
79
|
-
const frameSrc = ["'self'", ...this.getExistingCSPDetails(types_1.ExternalCspType.FRAME_SRC, existingCSPDetails)]
|
|
100
|
+
const frameSrc = ["'self'", hostname, ...this.getExistingCSPDetails(types_1.ExternalCspType.FRAME_SRC, existingCSPDetails)]
|
|
101
|
+
.filter((a) => a)
|
|
102
|
+
.join(' ');
|
|
80
103
|
const fontSrc = ["'self'", ...this.getExistingCSPDetails(types_1.ExternalCspType.FONT_SRC, existingCSPDetails)].join(' ');
|
|
81
104
|
const imgSrc = [
|
|
82
105
|
"'self'",
|
|
@@ -93,8 +116,11 @@ class CSPInjectionService {
|
|
|
93
116
|
"'self'",
|
|
94
117
|
'data:',
|
|
95
118
|
'blob:',
|
|
119
|
+
hostname,
|
|
96
120
|
...this.getExistingCSPDetails(types_1.ExternalCspType.MEDIA_SRC, existingCSPDetails)
|
|
97
|
-
]
|
|
121
|
+
]
|
|
122
|
+
.filter((a) => a)
|
|
123
|
+
.join(' ');
|
|
98
124
|
const connectSrc = [
|
|
99
125
|
"'self'",
|
|
100
126
|
...this.getConnectSrc(microsEnv, !!tunnelCSPReporterUri),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.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": "
|
|
15
|
-
"@forge/manifest": "
|
|
14
|
+
"@forge/cli-shared": "6.4.0",
|
|
15
|
+
"@forge/manifest": "8.1.0",
|
|
16
16
|
"@types/jest": "^29.5.12",
|
|
17
17
|
"@types/node": "14.18.63"
|
|
18
18
|
},
|