@adobe/helix-config 4.5.0 → 4.5.2

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
+ ## [4.5.2](https://github.com/adobe/helix-config/compare/v4.5.1...v4.5.2) (2024-09-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove tst support again ([#185](https://github.com/adobe/helix-config/issues/185)) ([6043644](https://github.com/adobe/helix-config/commit/6043644c43490e71b7b5ba2d97e2bf55f0ef519d))
7
+
8
+ ## [4.5.1](https://github.com/adobe/helix-config/compare/v4.5.0...v4.5.1) (2024-09-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * also respect org-tokens (regression) ([#184](https://github.com/adobe/helix-config/issues/184)) ([2ae41fa](https://github.com/adobe/helix-config/commit/2ae41fa518a32a5fc674bbc85796e21843fb3c3c))
14
+
1
15
  # [4.5.0](https://github.com/adobe/helix-config/compare/v4.4.0...v4.5.0) (2024-09-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -35,7 +35,7 @@
35
35
  "reporter-options": "configFile=.mocha-multi.json"
36
36
  },
37
37
  "devDependencies": {
38
- "@adobe/eslint-config-helix": "2.0.6",
38
+ "@adobe/eslint-config-helix": "2.0.7",
39
39
  "@semantic-release/changelog": "6.0.3",
40
40
  "@semantic-release/git": "10.0.1",
41
41
  "@semantic-release/npm": "12.0.1",
@@ -43,7 +43,7 @@
43
43
  "eslint": "8.57.0",
44
44
  "husky": "9.1.5",
45
45
  "junit-report-builder": "5.0.0",
46
- "lint-staged": "15.2.9",
46
+ "lint-staged": "15.2.10",
47
47
  "mocha": "10.7.3",
48
48
  "mocha-multi-reporters": "1.5.1",
49
49
  "mocha-suppress-logs": "0.5.1",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@adobe/fetch": "4.1.8",
59
- "@adobe/helix-shared-config": "10.6.7",
59
+ "@adobe/helix-shared-config": "10.6.8",
60
60
  "@adobe/helix-shared-utils": "3.0.2"
61
61
  }
62
62
  }
@@ -109,8 +109,9 @@ async function getGlobalTokenHash(ctx, rso) {
109
109
  /**
110
110
  * Returns the normalized access configuration for the give partition.
111
111
  */
112
- export async function getAccessConfig(ctx, config, partition, rso) {
113
- const { access, tokens = {} } = config;
112
+ export async function getAccessConfig(ctx, config, orgConfig, partition, rso) {
113
+ const { access } = config;
114
+ const tokens = { ...orgConfig?.tokens || {}, ...config.tokens };
114
115
  const pAccess = access[partition] ?? {};
115
116
  const apiKeyId = toArray(pAccess.apiKeyId ?? access.site?.apiKeyId);
116
117
  const allow = toArray(pAccess.allow ?? access.site?.allow);
@@ -302,12 +303,6 @@ export async function loadOrgConfig(ctx, org) {
302
303
  return res.body ? res.json() : null;
303
304
  }
304
305
 
305
- export async function loadTransientSiteToken(ctx, org, site) {
306
- const key = `orgs/${org}/sites/${site}/transient-site-tokens.json`;
307
- const res = await ctx.loader.getObject(HELIX_CONFIG_BUS, key);
308
- return res.body ? res.json() : null;
309
- }
310
-
311
306
  /**
312
307
  * Computes the access.admin.role arrays for the org users.
313
308
  * @param adminConfig
@@ -438,20 +433,13 @@ export async function getConfigResponse(ctx, opts) {
438
433
  // normalize access config
439
434
  const { admin = {} } = config.access;
440
435
  config.access = {
441
- preview: await getAccessConfig(ctx, config, 'preview', rso),
442
- live: await getAccessConfig(ctx, config, 'live', rso),
436
+ preview: await getAccessConfig(ctx, config, orgConfig, 'preview', rso),
437
+ live: await getAccessConfig(ctx, config, orgConfig, 'live', rso),
443
438
  // access.require.repository ?
444
439
  };
445
440
  if (opts.scope === SCOPE_ADMIN || opts.scope === SCOPE_RAW) {
446
441
  // eslint-disable-next-line max-len
447
442
  config.access.admin = computeSiteAdminRoles(admin, orgConfig, config.groups);
448
- } else {
449
- // for pipeline and delivery, also load the site tokens
450
- const tst = await loadTransientSiteToken(ctx, rso.org, rso.site);
451
- if (tst) {
452
- config.access.preview.transientSiteToken = tst.tokens.preview;
453
- config.access.live.transientSiteToken = tst.tokens.live;
454
- }
455
443
  }
456
444
  }
457
445
 
@@ -478,8 +466,6 @@ export async function getConfigResponse(ctx, opts) {
478
466
  'x-hlx-auth-clientdn-live': canonicalArrayString(config.access, 'live', 'clientCertDN'),
479
467
  'x-hlx-auth-hash-preview': canonicalArrayString(config.access, 'preview', 'tokenHash'),
480
468
  'x-hlx-auth-hash-live': canonicalArrayString(config.access, 'live', 'tokenHash'),
481
- 'x-hlx-auth-tst-preview': config.access?.preview?.transientSiteToken?.value || '',
482
- 'x-hlx-auth-tst-live': config.access?.live?.transientSiteToken?.value || '',
483
469
  },
484
470
  });
485
471
  }