@adobe/helix-html-pipeline 3.1.5 → 3.1.8

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 CHANGED
@@ -1,3 +1,24 @@
1
+ ## [3.1.8](https://github.com/adobe/helix-html-pipeline/compare/v3.1.7...v3.1.8) (2022-08-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#119](https://github.com/adobe/helix-html-pipeline/issues/119)) ([bfbad1e](https://github.com/adobe/helix-html-pipeline/commit/bfbad1ea4b75e8c0f3eb5c073b8f88b030d7667b))
7
+
8
+ ## [3.1.7](https://github.com/adobe/helix-html-pipeline/compare/v3.1.6...v3.1.7) (2022-08-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * auth on non-node runtime ([899d308](https://github.com/adobe/helix-html-pipeline/commit/899d3089b27cab075e19335913f4dc4fdc8041d7))
14
+
15
+ ## [3.1.6](https://github.com/adobe/helix-html-pipeline/compare/v3.1.5...v3.1.6) (2022-08-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * make auth portable ([5e012a8](https://github.com/adobe/helix-html-pipeline/commit/5e012a8fc8b659127a6ff4b33fab421cd538179a))
21
+
1
22
  ## [3.1.5](https://github.com/adobe/helix-html-pipeline/compare/v3.1.4...v3.1.5) (2022-07-28)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.1.5",
3
+ "version": "3.1.8",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -42,12 +42,12 @@
42
42
  "hast-util-to-html": "8.0.3",
43
43
  "hast-util-to-string": "2.0.0",
44
44
  "hastscript": "7.0.2",
45
- "jose": "4.8.3",
45
+ "jose": "4.9.0",
46
46
  "mdast-util-gfm-footnote": "1.0.1",
47
47
  "mdast-util-gfm-strikethrough": "1.0.1",
48
48
  "mdast-util-gfm-table": "1.0.4",
49
49
  "mdast-util-gfm-task-list-item": "1.0.1",
50
- "mdast-util-to-hast": "12.1.2",
50
+ "mdast-util-to-hast": "12.2.0",
51
51
  "mdast-util-to-string": "3.1.0",
52
52
  "micromark-extension-gfm-footnote": "1.0.4",
53
53
  "micromark-extension-gfm-strikethrough": "1.0.4",
@@ -66,7 +66,7 @@
66
66
  "unist-util-remove-position": "4.0.1",
67
67
  "unist-util-select": "4.0.1",
68
68
  "unist-util-visit": "4.1.0",
69
- "unist-util-visit-parents": "5.1.0"
69
+ "unist-util-visit-parents": "5.1.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@adobe/eslint-config-helix": "1.3.2",
@@ -75,15 +75,15 @@
75
75
  "@semantic-release/git": "10.0.1",
76
76
  "@semantic-release/npm": "9.0.1",
77
77
  "c8": "7.12.0",
78
- "eslint": "8.20.0",
78
+ "eslint": "8.22.0",
79
79
  "eslint-plugin-header": "3.1.1",
80
80
  "eslint-plugin-import": "2.26.0",
81
- "esmock": "1.8.4",
81
+ "esmock": "1.9.5",
82
82
  "husky": "8.0.1",
83
83
  "js-yaml": "4.1.0",
84
84
  "jsdoc-to-markdown": "7.1.1",
85
85
  "jsdom": "20.0.0",
86
- "junit-report-builder": "3.0.0",
86
+ "junit-report-builder": "3.0.1",
87
87
  "lint-staged": "13.0.3",
88
88
  "mocha": "10.0.0",
89
89
  "mocha-multi-reporters": "1.5.1",
package/src/utils/auth.js CHANGED
@@ -66,7 +66,14 @@ export async function decodeIdToken(state, idp, idToken, lenient = false) {
66
66
  // export the public key
67
67
  payload.pem = await exportSPKI(key);
68
68
  // and encode it base64 url
69
- payload.pem = Buffer.from(payload.pem, 'utf-8').toString('base64url');
69
+ /* c8 ignore next 3 */
70
+ if (typeof Buffer === 'undefined') {
71
+ // non-node runtime
72
+ payload.pem = btoa(payload.pem);
73
+ } else {
74
+ // node runtime
75
+ payload.pem = Buffer.from(payload.pem, 'utf-8').toString('base64url');
76
+ }
70
77
  payload.kid = protectedHeader.kid;
71
78
 
72
79
  log.info(`[auth] decoded id_token${lenient ? ' (lenient)' : ''} from ${payload.iss} and validated payload.`);
@@ -265,7 +272,8 @@ export class AuthInfo {
265
272
  grant_type: 'authorization_code',
266
273
  redirect_uri: state.createExternalLocation(AUTH_REDIRECT_URL),
267
274
  };
268
- const ret = await state.fetch(url.href, {
275
+ const { fetch } = state;
276
+ const ret = await fetch(url.href, {
269
277
  method: 'POST',
270
278
  body: new URLSearchParams(body).toString(),
271
279
  headers: {