@adobe/helix-config 4.14.4 → 5.1.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 +19 -0
- package/package.json +1 -1
- package/src/S3Loader.d.ts +9 -0
- package/src/config-legacy.js +1 -1
- package/src/config-view.js +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [5.1.0](https://github.com/adobe/helix-config/compare/v5.0.0...v5.1.0) (2025-04-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* support group references w/o .json ([#257](https://github.com/adobe/helix-config/issues/257)) ([013cb2a](https://github.com/adobe/helix-config/commit/013cb2a6f11cf8881966f97470c2a8eaeee81eb4)), closes [#256](https://github.com/adobe/helix-config/issues/256)
|
|
7
|
+
|
|
8
|
+
# [5.0.0](https://github.com/adobe/helix-config/compare/v4.14.4...v5.0.0) (2025-04-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 404 for refs/branches that don't exist ([#254](https://github.com/adobe/helix-config/issues/254)) ([aa4a6fe](https://github.com/adobe/helix-config/commit/aa4a6fe99cb843ef61afa118a891b0d0c8c0382f))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* support for dirExists
|
|
19
|
+
|
|
1
20
|
## [4.14.4](https://github.com/adobe/helix-config/compare/v4.14.3...v4.14.4) (2025-03-31)
|
|
2
21
|
|
|
3
22
|
|
package/package.json
CHANGED
package/src/S3Loader.d.ts
CHANGED
|
@@ -29,4 +29,13 @@ export declare interface S3Loader {
|
|
|
29
29
|
* @param {string} key
|
|
30
30
|
*/
|
|
31
31
|
headObject(bucketId, key): Promise<PipelineResponse>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Check whether a directory (or prefix) exists in S3. Returns a 200
|
|
35
|
+
* status if it exists, or 404 if it doesn't.
|
|
36
|
+
* @param {string} bucketId
|
|
37
|
+
* @param {string} prefix
|
|
38
|
+
* @return {Promise<PipelineResponse>}
|
|
39
|
+
*/
|
|
40
|
+
dirExists(bucketId: string, key: string): Promise<PipelineResponse>;
|
|
32
41
|
}
|
package/src/config-legacy.js
CHANGED
|
@@ -113,7 +113,7 @@ async function resolveAdminAccess(ctx, admin) {
|
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* Loads the content from a helix 4 project.
|
|
116
|
-
* @param {ConfigContext} ctx
|
|
116
|
+
* @param {import('./ConfigContext.js)'.ConfigContext} ctx
|
|
117
117
|
* @param {RSO} rso
|
|
118
118
|
* @param {string} scope
|
|
119
119
|
* @returns {Promise<ConfigObject|null>} the config object or {@code null} if not found.
|
package/src/config-view.js
CHANGED
|
@@ -297,6 +297,13 @@ async function resolveConfig(ctx, rso, scope) {
|
|
|
297
297
|
}
|
|
298
298
|
const site = new ConfigObject();
|
|
299
299
|
site.data = res.json();
|
|
300
|
+
|
|
301
|
+
const { code } = site.data;
|
|
302
|
+
const res2 = await ctx.loader.dirExists(HELIX_CODE_BUS, `${code.owner}/${code.repo}/${rso.ref}`);
|
|
303
|
+
if (res2.status !== 200) {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
|
|
300
307
|
site.updateLastModified(res.headers);
|
|
301
308
|
|
|
302
309
|
// always load default profile if available
|
|
@@ -399,15 +406,21 @@ function computeSiteAdminRoles(admin, orgConfig, configGroups = {}) {
|
|
|
399
406
|
for (const /* @type string */ entry of role) {
|
|
400
407
|
if (entry.indexOf('@') > 0) {
|
|
401
408
|
users.add(entry);
|
|
402
|
-
} else if (entry.startsWith('groups/')
|
|
409
|
+
} else if (entry.startsWith('groups/')) {
|
|
403
410
|
// keep entry in list so that admin can auto-migrate updates to the groups json
|
|
404
411
|
// TODO: remove after v4 EOL
|
|
405
412
|
users.add(entry);
|
|
406
|
-
|
|
413
|
+
const reference = entry.endsWith('.json')
|
|
414
|
+
? entry.substring(7, entry.length - 5)
|
|
415
|
+
: entry;
|
|
416
|
+
for (const email of resolveGroup(configGroups, reference)) {
|
|
407
417
|
users.add(email);
|
|
408
418
|
}
|
|
409
419
|
} else if (entry.startsWith('/groups/')) {
|
|
410
|
-
|
|
420
|
+
const reference = entry.endsWith('.json')
|
|
421
|
+
? entry.substring(8, entry.length - 5)
|
|
422
|
+
: entry;
|
|
423
|
+
for (const email of resolveGroup(orgGroups, reference)) {
|
|
411
424
|
users.add(email);
|
|
412
425
|
}
|
|
413
426
|
}
|