@adobe/helix-html-pipeline 6.0.0 → 6.0.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 +7 -0
- package/package.json +1 -1
- package/src/PipelineState.d.ts +12 -0
- package/src/PipelineState.js +7 -0
- package/src/utils/auth.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [6.0.1](https://github.com/adobe/helix-html-pipeline/compare/v6.0.0...v6.0.1) (2024-01-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* enforce rso ([#488](https://github.com/adobe/helix-html-pipeline/issues/488)) ([4b38e25](https://github.com/adobe/helix-html-pipeline/commit/4b38e2524514a3d64a041d456bf14fe8b2e416cb))
|
|
7
|
+
|
|
1
8
|
# [6.0.0](https://github.com/adobe/helix-html-pipeline/compare/v5.4.4...v6.0.0) (2024-01-10)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/PipelineState.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ declare interface PipelineOptions {
|
|
|
43
43
|
path: string;
|
|
44
44
|
timer: PipelineTimer;
|
|
45
45
|
env: object;
|
|
46
|
+
site: string;
|
|
47
|
+
org: string;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
declare class PipelineState {
|
|
@@ -70,6 +72,16 @@ declare class PipelineState {
|
|
|
70
72
|
*/
|
|
71
73
|
partition: string;
|
|
72
74
|
|
|
75
|
+
/**
|
|
76
|
+
* project site
|
|
77
|
+
*/
|
|
78
|
+
site: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* project org
|
|
82
|
+
*/
|
|
83
|
+
org: string;
|
|
84
|
+
|
|
73
85
|
/**
|
|
74
86
|
* Repository owner
|
|
75
87
|
*/
|
package/src/PipelineState.js
CHANGED
|
@@ -31,6 +31,8 @@ export class PipelineState {
|
|
|
31
31
|
config: opts.config,
|
|
32
32
|
content: new PipelineContent(),
|
|
33
33
|
contentBusId: opts.config.contentBusId,
|
|
34
|
+
site: opts.site,
|
|
35
|
+
org: opts.org,
|
|
34
36
|
owner: opts.config.owner,
|
|
35
37
|
repo: opts.config.repo,
|
|
36
38
|
ref: opts.ref,
|
|
@@ -44,6 +46,11 @@ export class PipelineState {
|
|
|
44
46
|
timer: opts.timer,
|
|
45
47
|
type: 'html',
|
|
46
48
|
});
|
|
49
|
+
for (const prop of ['org', 'site', 'contentBusId', 'repo', 'owner', 'ref', 'partition']) {
|
|
50
|
+
if (!this[prop]) {
|
|
51
|
+
throw new Error(`${prop} required`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
// eslint-disable-next-line class-methods-use-this
|
package/src/utils/auth.js
CHANGED
|
@@ -239,8 +239,8 @@ export class AuthInfo {
|
|
|
239
239
|
const url = new URL(idp.discovery.authorization_endpoint);
|
|
240
240
|
|
|
241
241
|
const tokenState = await signJWT(state, new SignJWT({
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
org: state.org,
|
|
243
|
+
site: state.site,
|
|
244
244
|
// this is our own login redirect, i.e. the current document
|
|
245
245
|
requestPath: state.info.path,
|
|
246
246
|
requestHost: host,
|
|
@@ -400,8 +400,8 @@ export async function initAuthRoute(state, req, res) {
|
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
// fixup pipeline state
|
|
403
|
-
state.
|
|
404
|
-
state.
|
|
403
|
+
state.org = req.params.state.org;
|
|
404
|
+
state.site = req.params.state.site;
|
|
405
405
|
state.ref = 'main';
|
|
406
406
|
state.partition = 'preview';
|
|
407
407
|
state.info.path = '/.auth';
|