@adobe/helix-config 3.5.0 → 3.6.1

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
+ ## [3.6.1](https://github.com/adobe/helix-config/compare/v3.6.0...v3.6.1) (2024-07-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency ajv to v8.17.1 ([45bd512](https://github.com/adobe/helix-config/commit/45bd51267c9046b499bef0d9a00b745e561fa567))
7
+
8
+ # [3.6.0](https://github.com/adobe/helix-config/compare/v3.5.0...v3.6.0) (2024-07-11)
9
+
10
+
11
+ ### Features
12
+
13
+ * allow to specify access.site ([#129](https://github.com/adobe/helix-config/issues/129)) ([83f7142](https://github.com/adobe/helix-config/commit/83f714215903315158ccacbf3ecfdb14d9d97c31)), closes [#62](https://github.com/adobe/helix-config/issues/62)
14
+
1
15
  # [3.5.0](https://github.com/adobe/helix-config/compare/v3.4.4...v3.5.0) (2024-07-10)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config",
3
- "version": "3.5.0",
3
+ "version": "3.6.1",
4
4
  "description": "Helix Config",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -64,7 +64,7 @@
64
64
  "@adobe/helix-shared-git": "3.0.12",
65
65
  "@adobe/helix-shared-storage": "1.0.2",
66
66
  "@adobe/helix-shared-utils": "3.0.2",
67
- "ajv": "8.16.0",
67
+ "ajv": "8.17.1",
68
68
  "ajv-formats": "3.0.1",
69
69
  "jose": "5.6.3"
70
70
  }
@@ -111,8 +111,9 @@ async function getGlobalTokenHash(ctx, rso) {
111
111
  */
112
112
  export async function getAccessConfig(ctx, config, partition, rso) {
113
113
  const { access, tokens = {} } = config;
114
- const apiKeyId = toArray(access[partition]?.apiKeyId ?? access.apiKeyId);
115
- const allow = toArray(access[partition]?.allow ?? access.allow);
114
+ const pAccess = access[partition] ?? {};
115
+ const apiKeyId = toArray(pAccess.apiKeyId ?? access.site?.apiKeyId ?? access.apiKeyId);
116
+ const allow = toArray(pAccess.allow ?? access.allow);
116
117
  const cfg = {
117
118
  apiKeyId,
118
119
  tokenHash: apiKeyId
@@ -120,7 +121,7 @@ export async function getAccessConfig(ctx, config, partition, rso) {
120
121
  .map((jti) => jti.replaceAll('/', '_').replaceAll('+', '-'))
121
122
  .map((id) => tokens[id]?.hash)
122
123
  .filter((hash) => !!hash),
123
- clientCertDN: toArray(access[partition]?.clientCertDN ?? access.clientCertDN),
124
+ clientCertDN: toArray(pAccess.clientCertDN ?? access.site?.clientCertDN ?? access.clientCertDN),
124
125
  };
125
126
  // if an allow is defined but no apiKeyId, create a fake one so that auth is still enforced.
126
127
  if (allow.length && !cfg.apiKeyId.length) {
@@ -18,6 +18,9 @@
18
18
  "admin": {
19
19
  "$ref": "https://ns.adobe.com/helix/config/access/admin"
20
20
  },
21
+ "site": {
22
+ "$ref": "https://ns.adobe.com/helix/config/access/site"
23
+ },
21
24
  "preview": {
22
25
  "$ref": "https://ns.adobe.com/helix/config/access/site"
23
26
  },
@@ -208,6 +208,7 @@ export interface EmptyConfig {
208
208
  }
209
209
  export interface Access {
210
210
  admin?: AdminAccessConfig;
211
+ site?: SiteAccessConfig;
211
212
  preview?: SiteAccessConfig;
212
213
  live?: SiteAccessConfig;
213
214
  }
@@ -216,6 +216,7 @@ export interface EmptyConfig {
216
216
  }
217
217
  export interface Access {
218
218
  admin?: AdminAccessConfig;
219
+ site?: SiteAccessConfig;
219
220
  preview?: SiteAccessConfig;
220
221
  live?: SiteAccessConfig;
221
222
  }