@adobe/helix-config 4.1.0 → 4.2.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 +14 -0
- package/package.json +4 -4
- package/src/config-view.js +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [4.2.0](https://github.com/adobe/helix-config/compare/v4.1.1...v4.2.0) (2024-08-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* remove original-site check (move to admin) ([#172](https://github.com/adobe/helix-config/issues/172)) ([ac915b7](https://github.com/adobe/helix-config/commit/ac915b714d4fc33163d1860a90263f5ff5962e1d))
|
|
7
|
+
|
|
8
|
+
## [4.1.1](https://github.com/adobe/helix-config/compare/v4.1.0...v4.1.1) (2024-08-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency @adobe/helix-shared-config to v10.6.6 ([00d8eae](https://github.com/adobe/helix-config/commit/00d8eae79c2ae176b7d9341d4dc47c5f646cf401))
|
|
14
|
+
|
|
1
15
|
# [4.1.0](https://github.com/adobe/helix-config/compare/v4.0.0...v4.1.0) (2024-08-15)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Helix Config",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"eslint": "8.57.0",
|
|
44
44
|
"husky": "9.1.4",
|
|
45
45
|
"junit-report-builder": "5.0.0",
|
|
46
|
-
"lint-staged": "15.2.
|
|
46
|
+
"lint-staged": "15.2.9",
|
|
47
47
|
"mocha": "10.7.3",
|
|
48
48
|
"mocha-multi-reporters": "1.5.1",
|
|
49
49
|
"mocha-suppress-logs": "0.5.1",
|
|
50
50
|
"nock": "13.5.4",
|
|
51
|
-
"semantic-release": "24.
|
|
51
|
+
"semantic-release": "24.1.0"
|
|
52
52
|
},
|
|
53
53
|
"lint-staged": {
|
|
54
54
|
"*.js": "eslint",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@adobe/fetch": "4.1.8",
|
|
59
|
-
"@adobe/helix-shared-config": "10.6.
|
|
59
|
+
"@adobe/helix-shared-config": "10.6.6",
|
|
60
60
|
"@adobe/helix-shared-utils": "3.0.2"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/src/config-view.js
CHANGED
|
@@ -185,27 +185,6 @@ async function loadMetadata(ctx, config, partition) {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
/**
|
|
189
|
-
* loads the original site information from the `.hlx.json` file
|
|
190
|
-
* @param ctx the context
|
|
191
|
-
* @param contentBusId the content bus id
|
|
192
|
-
* @param legacy if true, the original-repository is returned, otherwise the original-site.
|
|
193
|
-
* @returns {Promise<string>} the original site.
|
|
194
|
-
*/
|
|
195
|
-
async function fetchOriginalSite(ctx, contentBusId, legacy) {
|
|
196
|
-
const key = `${contentBusId}/.hlx.json`;
|
|
197
|
-
const res = await ctx.loader.getObject(HELIX_CONTENT_BUS, key);
|
|
198
|
-
if (res.body) {
|
|
199
|
-
const json = res.json();
|
|
200
|
-
if (legacy) {
|
|
201
|
-
return json['original-repository'];
|
|
202
|
-
}
|
|
203
|
-
return json['original-site'];
|
|
204
|
-
}
|
|
205
|
-
ctx.log.error(`failed to load ${key}: ${res.status}`);
|
|
206
|
-
return '';
|
|
207
|
-
}
|
|
208
|
-
|
|
209
188
|
async function loadHeadHtml(ctx, config, ref) {
|
|
210
189
|
const key = `${config.code.owner}/${config.code.repo}/${ref}/head.html`;
|
|
211
190
|
const res = await ctx.loader.getObject(HELIX_CODE_BUS, key);
|
|
@@ -408,21 +387,6 @@ export async function getConfigResponse(ctx, opts) {
|
|
|
408
387
|
},
|
|
409
388
|
});
|
|
410
389
|
}
|
|
411
|
-
// validate original-site
|
|
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
|
-
});
|
|
423
|
-
}
|
|
424
|
-
// todo: also send 403 for all scopes....but first observe only
|
|
425
|
-
}
|
|
426
390
|
|
|
427
391
|
if (config.extends && scope !== SCOPE_RAW) {
|
|
428
392
|
delete config.extends;
|