@adobe/helix-config 5.6.10 → 5.7.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.7.0](https://github.com/adobe/helix-config/compare/v5.6.11...v5.7.0) (2025-11-11)
2
+
3
+
4
+ ### Features
5
+
6
+ * include org and site apiKeys into admin scope ([#337](https://github.com/adobe/helix-config/issues/337)) ([ceed54e](https://github.com/adobe/helix-config/commit/ceed54ed5533da5cf9cd4702946af2165290722e))
7
+
8
+ ## [5.6.11](https://github.com/adobe/helix-config/compare/v5.6.10...v5.6.11) (2025-11-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * load head in delivery scope ([#334](https://github.com/adobe/helix-config/issues/334)) ([c3bba6d](https://github.com/adobe/helix-config/commit/c3bba6dc7b1e9d8c8954fde32625d5fea49246c9))
14
+
1
15
  ## [5.6.10](https://github.com/adobe/helix-config/compare/v5.6.9...v5.6.10) (2025-11-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "5.6.10",
3
+ "version": "5.7.0",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -44,7 +44,7 @@
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.5",
47
+ "lint-staged": "16.2.6",
48
48
  "mocha": "11.7.4",
49
49
  "mocha-multi-reporters": "1.5.1",
50
50
  "mocha-suppress-logs": "0.6.0",
@@ -336,9 +336,13 @@ async function resolveConfig(ctx, rso, scope) {
336
336
  config.robots = robots;
337
337
  }
338
338
  }
339
+ }
340
+ if (scope === SCOPE_PIPELINE || scope === SCOPE_RAW || scope === SCOPE_DELIVERY) {
341
+ // although not used in delivery, load in order to set correct last-modified
339
342
  ctx.timer?.update('head.html');
340
343
  config.head = await loadHeadHtml(ctx, config, rso.ref);
341
344
  }
345
+
342
346
  return site;
343
347
  }
344
348
 
@@ -388,6 +392,25 @@ function computeOrgAdminRoles(adminConfig, orgConfig) {
388
392
  }
389
393
  }
390
394
 
395
+ /**
396
+ * Apply org config apiKeys.
397
+ * @param adminConfig
398
+ * @param orgConfig
399
+ */
400
+ function applyOrgAPIKeys(adminConfig, orgConfig) {
401
+ const orgKeys = Object.keys(orgConfig.apiKeys ?? {});
402
+ if (orgKeys.length) {
403
+ const admin = deepGetOrCreate(adminConfig, ['access', 'admin'], true);
404
+ const apiKeyId = new Set([
405
+ ...admin.apiKeyId ?? [],
406
+ ...orgKeys,
407
+ ]);
408
+ if (apiKeyId.size) {
409
+ admin.apiKeyId = Array.from(apiKeyId).sort();
410
+ }
411
+ }
412
+ }
413
+
391
414
  /**
392
415
  * Extract the email addresses of the users for the given group.
393
416
  * @param groups
@@ -496,9 +519,14 @@ async function computeSiteAdminRoles(ctx, siteConfig, admin, orgConfig, configGr
496
519
  role: roles,
497
520
  };
498
521
 
499
- const apiKeyId = new Set([...admin.apiKeyId ?? [], ...orgConfig?.access?.admin?.apiKeyId ?? []]);
522
+ const apiKeyId = new Set([
523
+ ...admin.apiKeyId ?? [],
524
+ ...orgConfig?.access?.admin?.apiKeyId ?? [],
525
+ ...Object.keys(orgConfig?.apiKeys || {}),
526
+ ...Object.keys(siteConfig?.apiKeys || {}),
527
+ ]);
500
528
  if (apiKeyId.size) {
501
- ret.apiKeyId = Array.from(apiKeyId);
529
+ ret.apiKeyId = Array.from(apiKeyId).sort();
502
530
  }
503
531
  // if there are only roles from the org, ensure that they don't enforce auth
504
532
  if (hasOrgUsers && !hasRoles && (!admin.requireAuth || admin.requireAuth === 'auto')) {
@@ -728,6 +756,7 @@ export async function getOrgConfigResponse(ctx, opts) {
728
756
  };
729
757
 
730
758
  computeOrgAdminRoles(adminConfig, orgConfig);
759
+ applyOrgAPIKeys(adminConfig, orgConfig);
731
760
  delete adminConfig.tokens;
732
761
  delete adminConfig.users;
733
762
  delete adminConfig.groups;