@adobe/helix-config 5.9.4 → 5.10.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 +7 -0
- package/README.md +6 -0
- package/package.json +2 -2
- package/src/config-view.js +23 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [5.10.0](https://github.com/adobe/helix-config/compare/v5.9.4...v5.10.0) (2026-03-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* access.site secretIds with access.preview and access.live ([#364](https://github.com/adobe/helix-config/issues/364)) ([953f595](https://github.com/adobe/helix-config/commit/953f5958d9d05e5e69a06afd299ef87fe6d8ad4b)), closes [#363](https://github.com/adobe/helix-config/issues/363)
|
|
7
|
+
|
|
1
8
|
## [5.9.4](https://github.com/adobe/helix-config/compare/v5.9.3...v5.9.4) (2026-03-05)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -19,6 +19,12 @@ $ npm install @adobe/helix-config
|
|
|
19
19
|
|
|
20
20
|
See the [API documentation](docs/API.md).
|
|
21
21
|
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
### Access and secretIds
|
|
25
|
+
|
|
26
|
+
`secretId` (and legacy `apiKeyId`) can be set on `access.preview`, `access.live`, and `access.site`. The normalized config only has `access.preview` and `access.live`; `access.site` is used only during resolution. For each partition, the effective secretIds (and `allow`) are the **merge** of the partition’s list and `access.site`’s list—site values are merged in, not used as fallback only when the partition is empty.
|
|
27
|
+
|
|
22
28
|
## Development
|
|
23
29
|
|
|
24
30
|
### Build
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"description": "Helix Config",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@semantic-release/changelog": "6.0.3",
|
|
41
41
|
"@semantic-release/git": "10.0.1",
|
|
42
42
|
"@semantic-release/npm": "13.1.4",
|
|
43
|
-
"c8": "
|
|
43
|
+
"c8": "11.0.0",
|
|
44
44
|
"eslint": "9.4.0",
|
|
45
45
|
"husky": "9.1.7",
|
|
46
46
|
"junit-report-builder": "5.1.1",
|
package/src/config-view.js
CHANGED
|
@@ -144,22 +144,33 @@ function resolveSecret(object, idProp, dstProp, siteConfig, orgConfig) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* Returns the normalized access configuration for the
|
|
147
|
+
* Returns the normalized access configuration for the given partition.
|
|
148
|
+
*
|
|
149
|
+
* SecretIds (and legacy apiKeyIds) can be set on access.preview, access.live, and access.site.
|
|
150
|
+
* The normalized config only has access.preview and access.live; access.site is not present in
|
|
151
|
+
* the final object and is only used during resolution. For each partition (preview or live),
|
|
152
|
+
* the effective secretId and allow lists are the merge of the partition's values and
|
|
153
|
+
* access.site's values (union, deduplicated).
|
|
154
|
+
*
|
|
155
|
+
* @param {object} ctx - The context
|
|
156
|
+
* @param {object} config - The config (with access.preview, access.live, access.site)
|
|
157
|
+
* @param {object} orgConfig - The org config
|
|
158
|
+
* @param {'preview'|'live'} partition - The partition name
|
|
159
|
+
* @param {object} rso - RSO (ref, site, org)
|
|
160
|
+
* @returns {Promise<{secretId: string[], allow: string[], tokenHash: string[]}>}
|
|
161
|
+
* Normalized access config for the partition
|
|
148
162
|
*/
|
|
149
163
|
export async function getAccessConfig(ctx, config, orgConfig, partition, rso) {
|
|
150
164
|
const { access = {} } = config;
|
|
151
|
-
// get the (legacy) apiKeyIds or secretIds from the partition specific config
|
|
152
165
|
const pAccess = access[partition] ?? {};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
secretId
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
allow = uniqueArray(access.site?.allow);
|
|
162
|
-
}
|
|
166
|
+
// merge partition and site secretIds (and legacy apiKeyIds), then allow
|
|
167
|
+
const secretId = uniqueArray(
|
|
168
|
+
pAccess.apiKeyId,
|
|
169
|
+
pAccess.secretId,
|
|
170
|
+
access.site?.apiKeyId,
|
|
171
|
+
access.site?.secretId,
|
|
172
|
+
);
|
|
173
|
+
const allow = uniqueArray(pAccess.allow, access.site?.allow);
|
|
163
174
|
const cfg = {
|
|
164
175
|
secretId,
|
|
165
176
|
allow,
|