@forge/csp 5.4.0-next.0 → 5.4.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
+ ## 5.4.0-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6a0cb5e: Add macroParentHostDomain.cdn.[env].atlassian-dev.net conditionally to frameAncestors
8
+
3
9
  ## 5.4.0-next.0
4
10
 
5
11
  ### Minor Changes
@@ -18,13 +18,14 @@ export declare class CSPInjectionService {
18
18
  private getExistingCSPDetails;
19
19
  private getConnectSrc;
20
20
  private getFrameAncestors;
21
- getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions }: {
21
+ getInjectableCSP: ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHostDomain }: {
22
22
  existingCSPDetails: CSPDetails;
23
23
  microsEnv: LambdaEnvironment;
24
24
  tunnelCSPReporterUri?: string | undefined;
25
25
  hostname?: string | undefined;
26
26
  isFedRAMP?: boolean | undefined;
27
27
  icOptions?: IcOptions | undefined;
28
+ macroParentHostDomain?: string | undefined;
28
29
  }) => string[];
29
30
  }
30
31
  export {};
@@ -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;CAC3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D,UAAU;mBACnB,iBAAiB;;;;;;UAM1B,MAAM,EAAE,CAoFV;CACH"}
@@ -121,12 +121,12 @@ exports.getAtlassianImageHost = getAtlassianImageHost;
121
121
  exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
122
122
  class CSPInjectionService {
123
123
  constructor() {
124
- this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions }) => {
124
+ this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHostDomain }) => {
125
125
  const reportUri = tunnelCSPReporterUri || this.getCSPReportUri(microsEnv, icOptions);
126
126
  const defaultSrc = ["'self'", ...getFOSHostDownload(microsEnv, icOptions)].join(' ');
127
127
  const frameAncestors = [
128
128
  "'self'",
129
- ...this.getFrameAncestors(microsEnv, hostname, icOptions),
129
+ ...this.getFrameAncestors(microsEnv, hostname, icOptions, macroParentHostDomain),
130
130
  ...getFOSHostDownload(microsEnv, icOptions)
131
131
  ].join(' ');
132
132
  const frameSrc = [
@@ -243,7 +243,7 @@ class CSPInjectionService {
243
243
  allowed.push(...getFOSHostUpload(microsEnv, icOptions));
244
244
  return allowed;
245
245
  }
246
- getFrameAncestors(microsEnv, hostname, icOptions) {
246
+ getFrameAncestors(microsEnv, hostname, icOptions, macroParentHostDomain) {
247
247
  let frameAncestors = [];
248
248
  switch (microsEnv) {
249
249
  case 'dev':
@@ -256,6 +256,9 @@ class CSPInjectionService {
256
256
  '*.atl-paas.net',
257
257
  '*.stg.atlassian.com'
258
258
  ];
259
+ if (macroParentHostDomain) {
260
+ frameAncestors.push(`${macroParentHostDomain}.cdn.stg.atlassian-dev.net`);
261
+ }
259
262
  break;
260
263
  case 'fedramp-stg':
261
264
  frameAncestors = ['*.atlassian-stg-fedm.net'];
@@ -278,6 +281,9 @@ class CSPInjectionService {
278
281
  '*.atlassian.com',
279
282
  '*.frontend.public.atl-paas.net'
280
283
  ];
284
+ if (macroParentHostDomain) {
285
+ frameAncestors.push(`${macroParentHostDomain}.cdn.prod.atlassian-dev.net`);
286
+ }
281
287
  break;
282
288
  }
283
289
  if (hostname) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "5.4.0-next.0",
3
+ "version": "5.4.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,8 +11,8 @@
11
11
  "clean": "rm -rf ./out && rm -f tsconfig.tsbuildinfo"
12
12
  },
13
13
  "devDependencies": {
14
- "@forge/cli-shared": "8.9.1-next.2",
15
- "@forge/manifest": "11.1.0-next.1",
14
+ "@forge/cli-shared": "8.9.1-next.6",
15
+ "@forge/manifest": "11.1.0-next.4",
16
16
  "@types/jest": "^29.5.14",
17
17
  "@types/node": "20.19.1",
18
18
  "cheerio": "^1.1.0"