@forge/csp 5.2.0-next.2 → 5.2.0-next.4
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
|
+
## 5.2.0-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bafc49d: add fos hosts to getAtlassianImageHost
|
|
8
|
+
|
|
9
|
+
## 5.2.0-next.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f45e95a: Adding FOS to font-src and style-src CSP
|
|
14
|
+
|
|
3
15
|
## 5.2.0-next.2
|
|
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;AAEvD,aAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,aAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,aAAK,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,aAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,aAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,aAAK,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAoI1D,eAAO,MAAM,qBAAqB,cAAe,iBAAiB,cAAc,SAAS,KAAG,MAAM,EAWjG,CAAC;AAMF,eAAO,MAAM,kCAAkC,UAAiE,CAAC;AAEjH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,iBAAiB;IAiDlB,gBAAgB;4BAQD,UAAU;mBACnB,iBAAiB;;;;;UAK1B,MAAM,EAAE,CAwEV;CACH"}
|
|
@@ -93,16 +93,13 @@ const getAtlassianHost = (hostType, microsEnv, icOptions) => {
|
|
|
93
93
|
}
|
|
94
94
|
return hostMap[microsEnv];
|
|
95
95
|
};
|
|
96
|
-
const
|
|
96
|
+
const getFOSHostDownload = (microsEnv, icOptions) => {
|
|
97
97
|
const fosHost = getAtlassianHost('ATLASSIAN_FOS_HOST', microsEnv, icOptions);
|
|
98
|
-
return [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`${fosHost}/fop/cdn/upload/*/`,
|
|
104
|
-
`${fosHost}/fop/cdn/download/*/`
|
|
105
|
-
];
|
|
98
|
+
return [`${fosHost}/fos-eap/download/*/`, `${fosHost}/fop/app/download/*/`, `${fosHost}/fop/cdn/download/*/`];
|
|
99
|
+
};
|
|
100
|
+
const getFOSHostUpload = (microsEnv, icOptions) => {
|
|
101
|
+
const fosHost = getAtlassianHost('ATLASSIAN_FOS_HOST', microsEnv, icOptions);
|
|
102
|
+
return [`${fosHost}/fos-eap/upload/*/`, `${fosHost}/fop/app/upload/*/`, `${fosHost}/fop/cdn/upload/*/`];
|
|
106
103
|
};
|
|
107
104
|
const getAtlassianImageHost = (microsEnv, icOptions) => {
|
|
108
105
|
return [
|
|
@@ -112,7 +109,8 @@ const getAtlassianImageHost = (microsEnv, icOptions) => {
|
|
|
112
109
|
getAtlassianHost('ATLASSIAN_MEDIA_GATEWAY_HOST', microsEnv, icOptions),
|
|
113
110
|
getAtlassianHost('ATLASSIAN_EMOJIS_HOST', microsEnv, icOptions),
|
|
114
111
|
getAtlassianHost('ATLASSIAN_TEAM_AVATAR_HOST', microsEnv, icOptions),
|
|
115
|
-
getAtlassianHost('ATLASSIAN_TEAM_HEADER_HOST', microsEnv, icOptions)
|
|
112
|
+
getAtlassianHost('ATLASSIAN_TEAM_HEADER_HOST', microsEnv, icOptions),
|
|
113
|
+
...getFOSHostDownload(microsEnv, icOptions)
|
|
116
114
|
];
|
|
117
115
|
};
|
|
118
116
|
exports.getAtlassianImageHost = getAtlassianImageHost;
|
|
@@ -126,7 +124,11 @@ class CSPInjectionService {
|
|
|
126
124
|
const frameSrc = ["'self'", hostname, ...this.getExistingCSPDetails(types_1.ExternalCspType.FRAME_SRC, existingCSPDetails)]
|
|
127
125
|
.filter((a) => a)
|
|
128
126
|
.join(' ');
|
|
129
|
-
const fontSrc = [
|
|
127
|
+
const fontSrc = [
|
|
128
|
+
"'self'",
|
|
129
|
+
...getFOSHostDownload(microsEnv, icOptions),
|
|
130
|
+
...this.getExistingCSPDetails(types_1.ExternalCspType.FONT_SRC, existingCSPDetails)
|
|
131
|
+
].join(' ');
|
|
130
132
|
const imgSrc = [
|
|
131
133
|
"'self'",
|
|
132
134
|
'data:',
|
|
@@ -134,7 +136,6 @@ class CSPInjectionService {
|
|
|
134
136
|
hostname,
|
|
135
137
|
...exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS,
|
|
136
138
|
...(0, exports.getAtlassianImageHost)(microsEnv, icOptions),
|
|
137
|
-
...getFOSHost(microsEnv, icOptions),
|
|
138
139
|
...this.getExistingCSPDetails(types_1.ExternalCspType.IMG_SRC, existingCSPDetails)
|
|
139
140
|
]
|
|
140
141
|
.filter((a) => a)
|
|
@@ -157,13 +158,14 @@ class CSPInjectionService {
|
|
|
157
158
|
const scriptSrc = [
|
|
158
159
|
"'self'",
|
|
159
160
|
this.getForgeGlobalCSP(microsEnv, isFedRAMP, icOptions),
|
|
160
|
-
...
|
|
161
|
+
...getFOSHostDownload(microsEnv, icOptions),
|
|
161
162
|
...this.getExistingCSPDetails(types_1.ExternalCspType.SCRIPT_SRC, existingCSPDetails)
|
|
162
163
|
].join(' ');
|
|
163
164
|
const styleSrc = [
|
|
164
165
|
"'self'",
|
|
165
166
|
hostname,
|
|
166
167
|
this.getForgeGlobalCSP(microsEnv, isFedRAMP, icOptions),
|
|
168
|
+
...getFOSHostDownload(microsEnv, icOptions),
|
|
167
169
|
...this.getExistingCSPDetails(types_1.ExternalCspType.STYLE_SRC, existingCSPDetails)
|
|
168
170
|
]
|
|
169
171
|
.filter((a) => a)
|
|
@@ -221,7 +223,8 @@ class CSPInjectionService {
|
|
|
221
223
|
if (fopGeHost) {
|
|
222
224
|
allowed.push(fopGeHost);
|
|
223
225
|
}
|
|
224
|
-
allowed.push(...
|
|
226
|
+
allowed.push(...getFOSHostDownload(microsEnv, icOptions));
|
|
227
|
+
allowed.push(...getFOSHostUpload(microsEnv, icOptions));
|
|
225
228
|
return allowed;
|
|
226
229
|
}
|
|
227
230
|
getFrameAncestors(microsEnv, hostname, icOptions) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.4",
|
|
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": "8.8.1-next.
|
|
15
|
-
"@forge/manifest": "10.8.0-next.
|
|
14
|
+
"@forge/cli-shared": "8.8.1-next.3",
|
|
15
|
+
"@forge/manifest": "10.8.0-next.3",
|
|
16
16
|
"@types/jest": "^29.5.14",
|
|
17
17
|
"@types/node": "20.19.1",
|
|
18
18
|
"cheerio": "^1.1.0"
|