@forge/csp 6.4.1-next.3 → 6.4.2-experimental-e080d98

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,26 @@
1
1
  # @forge/csp
2
2
 
3
+ ## 6.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e609248: Select native UI worker bundles instead of iframe bundles for the local tunnel when the experimental worker runtime is enabled, including rebuilds for manual refresh. Restrict cross-origin reads to the Forge CDN origin for the selected environment.
8
+
9
+ ## 6.4.2-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - e609248: Select native UI worker bundles instead of iframe bundles for the local tunnel when the experimental worker runtime is enabled, including rebuilds for manual refresh. Restrict cross-origin reads to the Forge CDN origin for the selected environment.
14
+
15
+ ## 6.4.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 49bab87: Add the macro parent host to `frame-ancestors` in the injected CSP for FedRAMP staging and production
20
+ - 1991376: Include data URLs in font-src. Include Hello Jira domain in frame ancestors if Hello Confluence domain is already included
21
+ - 2e7a1d5: Added `rovo-desktop://com.atlassian.rovo-chat-desktop` to the `frame-ancestors` CSP directive.
22
+ - 6af1446: Allow Trello (`https://trello.com`, and `https://trellis.coffee` in dev/staging) and the Rovo Chrome extension as `frame-ancestors` in the injected CSP
23
+
3
24
  ## 6.4.1-next.3
4
25
 
5
26
  ### Patch Changes
@@ -11,9 +11,9 @@ type GetICDomainIcOptions = {
11
11
  type IcOptions = StandardIcOptions | GetICDomainIcOptions;
12
12
  export declare const getAtlassianImageHost: (microsEnv: LambdaEnvironment, icOptions?: IcOptions) => string[];
13
13
  export declare const EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS: string[];
14
+ export declare const getForgeCdnOrigin: (microsEnv: LambdaEnvironment, isFedRAMP?: boolean, icOptions?: IcOptions) => string;
14
15
  export declare class CSPInjectionService {
15
16
  private getCSPReportUri;
16
- private getForgeGlobalCSP;
17
17
  private getMetalClientCSP;
18
18
  private getExistingCSPDetails;
19
19
  private getConnectSrc;
@@ -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;AA+O1D,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;IAiGlB,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,CAuGV;CACH"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,CAuGV;CACH"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CSPInjectionService = exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = exports.getAtlassianImageHost = void 0;
3
+ exports.CSPInjectionService = exports.getForgeCdnOrigin = 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
6
  const isGCPEnvKey = (env) => env.endsWith('-gcentral');
@@ -179,6 +179,18 @@ const getAtlassianImageHost = (microsEnv, icOptions) => {
179
179
  };
180
180
  exports.getAtlassianImageHost = getAtlassianImageHost;
181
181
  exports.EXTERNAL_ALLOW_LISTED_IMAGES_HOSTS = ['https://secure.gravatar.com', 'https://images.unsplash.com'];
182
+ const getForgeCdnOrigin = (microsEnv, isFedRAMP = false, icOptions) => {
183
+ if (isICEnvKey(microsEnv) && icOptions) {
184
+ return `https://forge.forge-cdn.${getICDomain(microsEnv, icOptions)}`;
185
+ }
186
+ if (isGCPEnvKey(microsEnv)) {
187
+ return GCP_FORGE_CDN_HOST[microsEnv];
188
+ }
189
+ return isFedRAMP
190
+ ? `https://forge.cdn.${microsEnv.split('-')[1]}.atlassian-dev-us-gov-mod.net`
191
+ : `https://forge.cdn.${microsEnv}.atlassian-dev.net`;
192
+ };
193
+ exports.getForgeCdnOrigin = getForgeCdnOrigin;
182
194
  class CSPInjectionService {
183
195
  constructor() {
184
196
  this.getInjectableCSP = ({ existingCSPDetails, microsEnv, tunnelCSPReporterUri, hostname, isFedRAMP, icOptions, macroParentHost, connectMacroParentDomain, parentEmbeddingDomain }) => {
@@ -235,14 +247,14 @@ class CSPInjectionService {
235
247
  "'self'",
236
248
  hostname,
237
249
  ...this.getConnectSrc(microsEnv, !!tunnelCSPReporterUri, icOptions),
238
- this.getForgeGlobalCSP(microsEnv, isFedRAMP, icOptions),
250
+ (0, exports.getForgeCdnOrigin)(microsEnv, isFedRAMP, icOptions),
239
251
  ...this.getExistingCSPDetails(types_1.ExternalCspType.CONNECT_SRC, existingCSPDetails)
240
252
  ]
241
253
  .filter((a) => a)
242
254
  .join(' ');
243
255
  const scriptSrc = [
244
256
  "'self'",
245
- this.getForgeGlobalCSP(microsEnv, isFedRAMP, icOptions),
257
+ (0, exports.getForgeCdnOrigin)(microsEnv, isFedRAMP, icOptions),
246
258
  ...getFOSHostDownload(microsEnv, icOptions),
247
259
  ...fosCDNUrls,
248
260
  ...this.getExistingCSPDetails(types_1.ExternalCspType.SCRIPT_SRC, existingCSPDetails)
@@ -250,7 +262,7 @@ class CSPInjectionService {
250
262
  const styleSrc = [
251
263
  "'self'",
252
264
  hostname,
253
- this.getForgeGlobalCSP(microsEnv, isFedRAMP, icOptions),
265
+ (0, exports.getForgeCdnOrigin)(microsEnv, isFedRAMP, icOptions),
254
266
  ...getFOSHostDownload(microsEnv, icOptions),
255
267
  ...fosCDNUrls,
256
268
  ...this.getExistingCSPDetails(types_1.ExternalCspType.STYLE_SRC, existingCSPDetails)
@@ -279,17 +291,6 @@ class CSPInjectionService {
279
291
  return `https://web-security-reports.stg.services.atlassian.com/csp-report/${serviceName}`;
280
292
  return `https://web-security-reports.services.atlassian.com/csp-report/${serviceName}`;
281
293
  }
282
- getForgeGlobalCSP(microsEnv, isFedRAMP = false, icOptions) {
283
- if (isICEnvKey(microsEnv) && icOptions) {
284
- return `https://forge.forge-cdn.${getICDomain(microsEnv, icOptions)}`;
285
- }
286
- if (isGCPEnvKey(microsEnv)) {
287
- return GCP_FORGE_CDN_HOST[microsEnv];
288
- }
289
- return isFedRAMP
290
- ? `https://forge.cdn.${microsEnv.split('-')[1]}.atlassian-dev-us-gov-mod.net`
291
- : `https://forge.cdn.${microsEnv}.atlassian-dev.net`;
292
- }
293
294
  getMetalClientCSP(microsEnv, icOptions) {
294
295
  if (isICEnvKey(microsEnv) && icOptions) {
295
296
  return `https://api.${getICDomain(microsEnv, icOptions)}/metal/ingest`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "6.4.1-next.3",
3
+ "version": "6.4.2-experimental-e080d98",
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.10.0-next.19",
15
- "@forge/manifest": "13.9.0-next.8",
14
+ "@forge/cli-shared": "10.0.1-next.4-experimental-e080d98",
15
+ "@forge/manifest": "13.9.2-next.0-experimental-e080d98",
16
16
  "@types/jest": "^30.0.0",
17
17
  "@types/node": "20.19.1",
18
18
  "cheerio": "^1.2.0",