@adobe/helix-config 5.7.0 → 5.9.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,3 +1,17 @@
1
+ # [5.9.0](https://github.com/adobe/helix-config/compare/v5.8.0...v5.9.0) (2026-01-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * add trusted origins header in delivery and pipeline scope ([#349](https://github.com/adobe/helix-config/issues/349)) ([0a4a8c1](https://github.com/adobe/helix-config/commit/0a4a8c1b39a597f1b43fd11ca5978c0e167db9e3))
7
+
8
+ # [5.8.0](https://github.com/adobe/helix-config/compare/v5.7.0...v5.8.0) (2025-12-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * include code bus sidekick in admin config ([#345](https://github.com/adobe/helix-config/issues/345)) ([6837ece](https://github.com/adobe/helix-config/commit/6837ece3169bc0d4863dd796e49b493fa1933859))
14
+
1
15
  # [5.7.0](https://github.com/adobe/helix-config/compare/v5.6.11...v5.7.0) (2025-11-11)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "5.7.0",
3
+ "version": "5.9.0",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -35,20 +35,20 @@
35
35
  "reporter-options": "configFile=.mocha-multi.json"
36
36
  },
37
37
  "devDependencies": {
38
- "@adobe/eslint-config-helix": "3.0.13",
39
- "@eslint/config-helpers": "0.4.1",
38
+ "@adobe/eslint-config-helix": "3.0.15",
39
+ "@eslint/config-helpers": "0.5.0",
40
40
  "@semantic-release/changelog": "6.0.3",
41
41
  "@semantic-release/git": "10.0.1",
42
- "@semantic-release/npm": "13.1.1",
42
+ "@semantic-release/npm": "13.1.3",
43
43
  "c8": "10.1.3",
44
44
  "eslint": "9.4.0",
45
45
  "husky": "9.1.7",
46
46
  "junit-report-builder": "5.1.1",
47
- "lint-staged": "16.2.6",
48
- "mocha": "11.7.4",
47
+ "lint-staged": "16.2.7",
48
+ "mocha": "11.7.5",
49
49
  "mocha-multi-reporters": "1.5.1",
50
50
  "mocha-suppress-logs": "0.6.0",
51
- "semantic-release": "25.0.1"
51
+ "semantic-release": "25.0.2"
52
52
  },
53
53
  "lint-staged": {
54
54
  "*.js": "eslint",
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * @typedef RootProperty
16
16
  * @property {boolean} atomic whether the property should be overwritten atomically
17
- * @property {boolean} isModified whether the property need special merging
17
+ * @property {boolean} isModifier whether the property need special merging
18
18
  */
19
19
 
20
20
  const ROOT_PROPERTIES = {
@@ -243,6 +243,20 @@ async function loadHeadHtml(ctx, config, ref) {
243
243
  return {};
244
244
  }
245
245
 
246
+ async function loadSidekickConfig(ctx, config) {
247
+ const key = `${config.code.owner}/${config.code.repo}/main/tools/sidekick/config.json`;
248
+ const res = await ctx.loader.getObject(HELIX_CODE_BUS, key);
249
+ if (res.body) {
250
+ const sidekick = new ConfigObject();
251
+ sidekick.data = JSON.parse(res.body);
252
+ sidekick.updateLastModified(res.headers);
253
+ // remove deprecated properties
254
+ delete sidekick.data.extends;
255
+ return sidekick;
256
+ }
257
+ return {};
258
+ }
259
+
246
260
  function retainProperty(obj, prop) {
247
261
  if (!obj || Array.isArray(obj)) {
248
262
  return;
@@ -338,10 +352,15 @@ async function resolveConfig(ctx, rso, scope) {
338
352
  }
339
353
  }
340
354
  if (scope === SCOPE_PIPELINE || scope === SCOPE_RAW || scope === SCOPE_DELIVERY) {
341
- // although not used in delivery, load in order to set correct last-modified
355
+ // although not used in raw, or delivery, load in order to set correct last-modified
342
356
  ctx.timer?.update('head.html');
343
357
  config.head = await loadHeadHtml(ctx, config, rso.ref);
344
358
  }
359
+ if (scope === SCOPE_ADMIN || scope === SCOPE_RAW) {
360
+ // although not used in raw, in order to set correct last-modified
361
+ ctx.timer?.update('sidekick.json');
362
+ site.sidekick = await loadSidekickConfig(ctx, config);
363
+ }
345
364
 
346
365
  return site;
347
366
  }
@@ -535,6 +554,40 @@ async function computeSiteAdminRoles(ctx, siteConfig, admin, orgConfig, configGr
535
554
  return ret;
536
555
  }
537
556
 
557
+ /**
558
+ * Compute the trusted hosts for the given site.
559
+ * @param {string} org The org name
560
+ * @param {strinf} site The site name
561
+ * @param {SiteConfig} siteConfig The site config
562
+ * @returns {string[]} The trusted hosts
563
+ */
564
+ function computeTrustedHosts(org, site, siteConfig) {
565
+ const trustedHosts = [
566
+ `*--${site}--${org}.aem.page`,
567
+ `*--${site}--${org}.aem.live`,
568
+ `*--${site}--${org}.aem.reviews`,
569
+ `*--${site}--${org}.aem.network`,
570
+ ];
571
+
572
+ if (siteConfig.cdn?.preview?.host) {
573
+ trustedHosts.push(siteConfig.cdn.preview.host);
574
+ }
575
+
576
+ if (siteConfig.cdn?.live?.host) {
577
+ trustedHosts.push(siteConfig.cdn.live.host);
578
+ }
579
+
580
+ if (siteConfig.cdn?.prod?.host) {
581
+ trustedHosts.push(siteConfig.cdn.prod.host);
582
+ }
583
+
584
+ if (siteConfig.sidekick?.trustedHosts) {
585
+ trustedHosts.push(...siteConfig.sidekick.trustedHosts);
586
+ }
587
+
588
+ return trustedHosts;
589
+ }
590
+
538
591
  export async function getConfigResponse(ctx, opts) {
539
592
  const {
540
593
  ref, site, org, scope,
@@ -609,6 +662,7 @@ export async function getConfigResponse(ctx, opts) {
609
662
 
610
663
  // todo: improve
611
664
  siteConfig.updateLastModified(config.head);
665
+ siteConfig.updateLastModified(siteConfig.sidekick);
612
666
  siteConfig.updateLastModified(config.robots);
613
667
  siteConfig.updateLastModified(config.metadata?.preview);
614
668
  siteConfig.updateLastModified(config.metadata?.live);
@@ -627,6 +681,7 @@ export async function getConfigResponse(ctx, opts) {
627
681
  'x-hlx-repo': config.code.repo,
628
682
  'x-hlx-auth-hash-preview': canonicalArrayString(config.access, 'preview', 'tokenHash'),
629
683
  'x-hlx-auth-hash-live': canonicalArrayString(config.access, 'live', 'tokenHash'),
684
+ 'x-hlx-trusted-hosts': computeTrustedHosts(org, site, config).join(','),
630
685
  },
631
686
  });
632
687
  }
@@ -650,6 +705,7 @@ export async function getConfigResponse(ctx, opts) {
650
705
  if (opts.scope === SCOPE_ADMIN) {
651
706
  const adminConfig = {
652
707
  ...rso,
708
+ sidekick: siteConfig.sidekick?.data,
653
709
  ...config,
654
710
  content: {
655
711
  ...config.content,
@@ -695,6 +751,7 @@ export async function getConfigResponse(ctx, opts) {
695
751
  access: config.access,
696
752
  legacy: config.legacy,
697
753
  lastModified: siteConfig.lastModified,
754
+ trustedHosts: computeTrustedHosts(org, site, config),
698
755
  };
699
756
  if (config.features) {
700
757
  pipelineConfig.features = config.features;