@forge/csp 6.0.0 → 6.1.0-next.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,11 @@
|
|
|
1
1
|
# @forge/csp
|
|
2
2
|
|
|
3
|
+
## 6.1.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9390d98: Add optional `parentEmbeddingDomain` parameter to the CSP injection service. When provided, the domain is appended to the `frame-ancestors` directive, allowing Forge apps embedded in Confluence pages served on a custom parent domain to load.
|
|
8
|
+
|
|
3
9
|
## 6.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -18,7 +18,7 @@ export declare class CSPInjectionService {
|
|
|
18
18
|
private getExistingCSPDetails;
|
|
19
19
|
private getConnectSrc;
|
|
20
20
|
private getFrameAncestors;
|
|
21
|
-
getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain }: {
|
|
21
|
+
getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain, parentEmbeddingDomain }: {
|
|
22
22
|
existingCSPDetails: CSPDetails;
|
|
23
23
|
microsEnv: LambdaEnvironment;
|
|
24
24
|
tunnelCSPReporterUri?: string;
|
|
@@ -27,6 +27,7 @@ export declare class CSPInjectionService {
|
|
|
27
27
|
icOptions?: IcOptions;
|
|
28
28
|
macroParentHost?: string;
|
|
29
29
|
connectMacroParentDomain?: string;
|
|
30
|
+
parentEmbeddingDomain?: string;
|
|
30
31
|
}) => string[];
|
|
31
32
|
}
|
|
32
33
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csp-injection-service.d.ts","sourceRoot":"","sources":["../../src/csp/csp-injection-service.ts"],"names":[],"mappings":"AAAA,OAAO,K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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;IAmCrB,OAAO,CAAC,iBAAiB;IA4ElB,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"}
|
|
@@ -147,13 +147,13 @@ exports.getAtlassianImageHost = getAtlassianImageHost;
|
|
|
147
147
|
exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
|
|
148
148
|
class CSPInjectionService {
|
|
149
149
|
constructor() {
|
|
150
|
-
this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain }) => {
|
|
150
|
+
this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain, parentEmbeddingDomain }) => {
|
|
151
151
|
const reportUri = tunnelCSPReporterUri || this.getCSPReportUri(microsEnv, icOptions);
|
|
152
152
|
const fosCDNUrls = getFOSCDNUrls(microsEnv, icOptions);
|
|
153
153
|
const defaultSrc = ["'self'", ...getFOSHostDownload(microsEnv, icOptions), ...fosCDNUrls].join(' ');
|
|
154
154
|
const frameAncestors = [
|
|
155
155
|
"'self'",
|
|
156
|
-
...this.getFrameAncestors(microsEnv, hostname, icOptions, macroParentHost, connectMacroParentDomain),
|
|
156
|
+
...this.getFrameAncestors(microsEnv, hostname, icOptions, macroParentHost, connectMacroParentDomain, parentEmbeddingDomain),
|
|
157
157
|
...getFOSHostDownload(microsEnv, icOptions),
|
|
158
158
|
...fosCDNUrls
|
|
159
159
|
].join(' ');
|
|
@@ -281,7 +281,7 @@ class CSPInjectionService {
|
|
|
281
281
|
allowed.push(...getFOSCDNUrls(microsEnv, icOptions));
|
|
282
282
|
return allowed;
|
|
283
283
|
}
|
|
284
|
-
getFrameAncestors(microsEnv, hostname, icOptions, macroParentHost, connectMacroParentDomain) {
|
|
284
|
+
getFrameAncestors(microsEnv, hostname, icOptions, macroParentHost, connectMacroParentDomain, parentEmbeddingDomain) {
|
|
285
285
|
let frameAncestors = [];
|
|
286
286
|
const localhostWithPortRegex = /^localhost:\d+$/;
|
|
287
287
|
switch (microsEnv) {
|
|
@@ -333,6 +333,9 @@ class CSPInjectionService {
|
|
|
333
333
|
if (connectMacroParentDomain) {
|
|
334
334
|
frameAncestors.push(connectMacroParentDomain);
|
|
335
335
|
}
|
|
336
|
+
if (parentEmbeddingDomain) {
|
|
337
|
+
frameAncestors.push(parentEmbeddingDomain);
|
|
338
|
+
}
|
|
336
339
|
if (hostname) {
|
|
337
340
|
frameAncestors.push(hostname);
|
|
338
341
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/csp",
|
|
3
|
-
"version": "6.0.0",
|
|
3
|
+
"version": "6.1.0-next.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.0.
|
|
15
|
-
"@forge/manifest": "13.0.
|
|
14
|
+
"@forge/cli-shared": "9.0.1-next.8",
|
|
15
|
+
"@forge/manifest": "13.1.0-next.6",
|
|
16
16
|
"@types/jest": "^29.5.14",
|
|
17
17
|
"@types/node": "20.19.1",
|
|
18
18
|
"cheerio": "^1.2.0",
|