@adobe/helix-config 3.12.0 → 3.13.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 +14 -0
- package/package.json +5 -5
- package/src/config-view.js +18 -16
- package/src/schemas/content.schema.json +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.13.1](https://github.com/adobe/helix-config/compare/v3.13.0...v3.13.1) (2024-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* respect only original-site ([#162](https://github.com/adobe/helix-config/issues/162)) ([155c485](https://github.com/adobe/helix-config/commit/155c4853ed9d3f16b455a181d1340e9a01690033))
|
|
7
|
+
|
|
8
|
+
# [3.13.0](https://github.com/adobe/helix-config/compare/v3.12.0...v3.13.0) (2024-08-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* support content overlay in content schema ([bb45473](https://github.com/adobe/helix-config/commit/bb454730c20a882a9541f5e73a6b05d59391d250))
|
|
14
|
+
|
|
1
15
|
# [3.12.0](https://github.com/adobe/helix-config/compare/v3.11.1...v3.12.0) (2024-07-31)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.1",
|
|
4
4
|
"description": "Helix Config",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"ajv-cli": "5.0.0",
|
|
45
45
|
"c8": "10.1.2",
|
|
46
46
|
"eslint": "8.57.0",
|
|
47
|
-
"husky": "9.1.
|
|
47
|
+
"husky": "9.1.4",
|
|
48
48
|
"json-schema-to-typescript": "15.0.0",
|
|
49
|
-
"junit-report-builder": "
|
|
50
|
-
"lint-staged": "15.2.
|
|
51
|
-
"mocha": "10.7.
|
|
49
|
+
"junit-report-builder": "5.0.0",
|
|
50
|
+
"lint-staged": "15.2.8",
|
|
51
|
+
"mocha": "10.7.3",
|
|
52
52
|
"mocha-multi-reporters": "1.5.1",
|
|
53
53
|
"mocha-suppress-logs": "0.5.1",
|
|
54
54
|
"nock": "13.5.4",
|
package/src/config-view.js
CHANGED
|
@@ -189,14 +189,18 @@ async function loadMetadata(ctx, config, partition) {
|
|
|
189
189
|
* loads the original site information from the `.hlx.json` file
|
|
190
190
|
* @param ctx the context
|
|
191
191
|
* @param contentBusId the content bus id
|
|
192
|
+
* @param legacy if true, the original-repository is returned, otherwise the original-site.
|
|
192
193
|
* @returns {Promise<string>} the original site.
|
|
193
194
|
*/
|
|
194
|
-
async function fetchOriginalSite(ctx, contentBusId) {
|
|
195
|
+
async function fetchOriginalSite(ctx, contentBusId, legacy) {
|
|
195
196
|
const key = `${contentBusId}/.hlx.json`;
|
|
196
197
|
const res = await ctx.loader.getObject(HELIX_CONTENT_BUS, key);
|
|
197
198
|
if (res.body) {
|
|
198
199
|
const json = res.json();
|
|
199
|
-
|
|
200
|
+
if (legacy) {
|
|
201
|
+
return json['original-repository'];
|
|
202
|
+
}
|
|
203
|
+
return json['original-site'];
|
|
200
204
|
}
|
|
201
205
|
ctx.log.error(`failed to load ${key}: ${res.status}`);
|
|
202
206
|
return '';
|
|
@@ -405,21 +409,19 @@ export async function getConfigResponse(ctx, opts) {
|
|
|
405
409
|
});
|
|
406
410
|
}
|
|
407
411
|
// validate original-site
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
// todo: also send 403 for all scopes....but first observe only
|
|
412
|
+
const originalSite = await fetchOriginalSite(ctx, config.content.contentBusId, config.legacy);
|
|
413
|
+
if (originalSite && originalSite !== `${org}/${site}`) {
|
|
414
|
+
ctx.log.error(`original site ${originalSite} does not match requested ${org}/${site}.`);
|
|
415
|
+
if (scope === SCOPE_ADMIN) {
|
|
416
|
+
return new PipelineResponse('', {
|
|
417
|
+
status: 403,
|
|
418
|
+
headers: {
|
|
419
|
+
'x-error': 'original site mismatch',
|
|
420
|
+
...surrogateHeaders,
|
|
421
|
+
},
|
|
422
|
+
});
|
|
422
423
|
}
|
|
424
|
+
// todo: also send 403 for all scopes....but first observe only
|
|
423
425
|
}
|
|
424
426
|
|
|
425
427
|
if (config.extends && scope !== SCOPE_RAW) {
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
{ "$ref": "https://ns.adobe.com/helix/config/content-source/onedrive" },
|
|
16
16
|
{ "$ref": "https://ns.adobe.com/helix/config/content-source/markup" }
|
|
17
17
|
]
|
|
18
|
+
},
|
|
19
|
+
"overlay": {
|
|
20
|
+
"oneOf": [
|
|
21
|
+
{ "$ref": "https://ns.adobe.com/helix/config/content-source/markup" }
|
|
22
|
+
]
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
"required": [
|