@adobe/helix-config 3.2.14 → 3.2.15

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,10 @@
1
+ ## [3.2.15](https://github.com/adobe/helix-config/compare/v3.2.14...v3.2.15) (2024-06-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * legacy sites with apiKey but no allow must not authenticate ([#109](https://github.com/adobe/helix-config/issues/109)) ([421575e](https://github.com/adobe/helix-config/commit/421575eb9093820a824031695f26bbc568dd4505)), closes [#91](https://github.com/adobe/helix-config/issues/91)
7
+
1
8
  ## [3.2.14](https://github.com/adobe/helix-config/compare/v3.2.13...v3.2.14) (2024-06-20)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "3.2.14",
3
+ "version": "3.2.15",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -131,6 +131,7 @@ export async function resolveLegacyConfig(ctx, rso, scope) {
131
131
  }
132
132
  const config = {
133
133
  version: 1,
134
+ legacy: true,
134
135
  code: {
135
136
  owner: rso.org,
136
137
  repo: rso.site,
@@ -122,8 +122,7 @@ export async function getAccessConfig(ctx, config, partition, rso) {
122
122
  .filter((hash) => !!hash),
123
123
  clientCertDN: toArray(access[partition]?.clientCertDN ?? access.clientCertDN),
124
124
  };
125
- // if an allow is defined but no apiKeyId, create a fake one so that auth is still
126
- // enforced. later we can remove the allow and the apiKeyId in favor of the tokenHash
125
+ // if an allow is defined but no apiKeyId, create a fake one so that auth is still enforced.
127
126
  if (allow.length && !cfg.apiKeyId.length) {
128
127
  cfg.apiKeyId.push('dummy');
129
128
  }
@@ -137,7 +136,10 @@ export async function getAccessConfig(ctx, config, partition, rso) {
137
136
  cfg.tokenHash.push(globalTokenHash);
138
137
  } else if (!cfg.tokenHash.length) {
139
138
  // add a dummy or global hash if no tokens match the apiKeyIds.
140
- cfg.tokenHash.push(globalTokenHash || 'n/a');
139
+ if (!config.legacy || allow.length) {
140
+ // but only add for non-legacy sites or legacy with allows
141
+ cfg.tokenHash.push(globalTokenHash || 'n/a');
142
+ }
141
143
  }
142
144
  }
143
145