@forge/csp 6.4.1 → 6.4.2-experimental-85e55b1

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
+ ## 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
+
3
15
  ## 6.4.1
4
16
 
5
17
  ### 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,CAA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C,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,eAAO,MAAM,iBAAiB,GAAI,WAAW,iBAAiB,EAAE,mBAAiB,EAAE,YAAY,SAAS,KAAG,MAU1G,CAAC;AAEF,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,eAAe;IAQvB,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"}
@@ -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`;
@@ -334,6 +335,7 @@ class CSPInjectionService {
334
335
  'https://integration.bb-inf.net',
335
336
  'https://trellis.coffee',
336
337
  'chrome-extension://npbjhobkibekbklkghlhfhieggcggpdb',
338
+ 'rovo-desktop://com.atlassian.rovo-chat-desktop',
337
339
  '*.atl-paas.net',
338
340
  '*.stg.atlassian.com'
339
341
  ];
@@ -366,6 +368,7 @@ class CSPInjectionService {
366
368
  'bitbucket.org',
367
369
  'https://trello.com',
368
370
  'chrome-extension://npbjhobkibekbklkghlhfhieggcggpdb',
371
+ 'rovo-desktop://com.atlassian.rovo-chat-desktop',
369
372
  '*.jira.com',
370
373
  '*.atlassian.com',
371
374
  '*.frontend.public.atl-paas.net'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/csp",
3
- "version": "6.4.1",
3
+ "version": "6.4.2-experimental-85e55b1",
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",
15
- "@forge/manifest": "13.9.0",
14
+ "@forge/cli-shared": "10.1.0-next.16-experimental-85e55b1",
15
+ "@forge/manifest": "13.10.0-next.3-experimental-85e55b1",
16
16
  "@types/jest": "^30.0.0",
17
17
  "@types/node": "20.19.1",
18
18
  "cheerio": "^1.2.0",