@adobe/helix-html-pipeline 3.8.8 → 3.8.10

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,17 @@
1
+ ## [3.8.10](https://github.com/adobe/helix-html-pipeline/compare/v3.8.9...v3.8.10) (2023-02-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * prevent prototype pollution ([#265](https://github.com/adobe/helix-html-pipeline/issues/265)) ([6902eb4](https://github.com/adobe/helix-html-pipeline/commit/6902eb4cbd2682633560b1cf6004cd22cf0988b4))
7
+
8
+ ## [3.8.9](https://github.com/adobe/helix-html-pipeline/compare/v3.8.8...v3.8.9) (2023-02-06)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * allow admin jwts ([#258](https://github.com/adobe/helix-html-pipeline/issues/258)) ([312f17d](https://github.com/adobe/helix-html-pipeline/commit/312f17d018b717e35189bca81dee0baa05f531ae))
14
+
1
15
  ## [3.8.8](https://github.com/adobe/helix-html-pipeline/compare/v3.8.7...v3.8.8) (2023-02-01)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.8.8",
3
+ "version": "3.8.10",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -50,12 +50,12 @@
50
50
  "hast-util-to-html": "8.0.4",
51
51
  "hast-util-to-string": "2.0.0",
52
52
  "hastscript": "7.2.0",
53
- "jose": "4.11.2",
53
+ "jose": "4.12.0",
54
54
  "mdast-util-gfm-footnote": "1.0.2",
55
- "mdast-util-gfm-strikethrough": "1.0.2",
56
- "mdast-util-gfm-table": "1.0.6",
55
+ "mdast-util-gfm-strikethrough": "1.0.3",
56
+ "mdast-util-gfm-table": "1.0.7",
57
57
  "mdast-util-gfm-task-list-item": "1.0.2",
58
- "mdast-util-to-hast": "12.2.6",
58
+ "mdast-util-to-hast": "12.3.0",
59
59
  "mdast-util-to-string": "3.1.1",
60
60
  "micromark-extension-gfm-footnote": "1.0.4",
61
61
  "micromark-extension-gfm-strikethrough": "1.0.4",
@@ -82,8 +82,8 @@
82
82
  "@semantic-release/changelog": "6.0.2",
83
83
  "@semantic-release/git": "10.0.1",
84
84
  "@semantic-release/npm": "9.0.2",
85
- "c8": "7.12.0",
86
- "eslint": "8.32.0",
85
+ "c8": "7.13.0",
86
+ "eslint": "8.34.0",
87
87
  "eslint-import-resolver-exports": "1.0.0-beta.4",
88
88
  "eslint-plugin-header": "3.1.1",
89
89
  "eslint-plugin-import": "2.27.5",
@@ -92,11 +92,11 @@
92
92
  "js-yaml": "4.1.0",
93
93
  "jsdom": "21.1.0",
94
94
  "junit-report-builder": "3.0.1",
95
- "lint-staged": "13.1.0",
95
+ "lint-staged": "13.1.2",
96
96
  "mocha": "10.2.0",
97
97
  "mocha-multi-reporters": "1.5.1",
98
98
  "remark-gfm": "3.0.1",
99
- "semantic-release": "19.0.5"
99
+ "semantic-release": "20.1.0"
100
100
  },
101
101
  "lint-staged": {
102
102
  "*.js": "eslint",
package/src/forms-pipe.js CHANGED
@@ -28,7 +28,7 @@ function error(log, msg, status, response) {
28
28
  * @returns {Object} The converted object
29
29
  */
30
30
  function searchParamsToObject(searchParams) {
31
- const result = {};
31
+ const result = Object.create(null);
32
32
 
33
33
  for (const key of searchParams.keys()) {
34
34
  // get all values association with the key
@@ -37,7 +37,7 @@ function toList(list) {
37
37
  * @returns {object} The block config
38
38
  */
39
39
  function readBlockConfig($block) {
40
- const config = {};
40
+ const config = Object.create(null);
41
41
  selectAll(':scope>div', $block).forEach(($row) => {
42
42
  if ($row?.children[1]) {
43
43
  const [$name, $value] = $row.children;
@@ -15,7 +15,7 @@ import { rewriteUrl } from './utils.js';
15
15
 
16
16
  function yaml(section) {
17
17
  section.meta = selectAll('yaml', section)
18
- .reduce((prev, { payload }) => Object.assign(prev, payload), {});
18
+ .reduce((prev, { payload }) => Object.assign(prev, payload), Object.create(null));
19
19
  return section;
20
20
  }
21
21
 
@@ -13,7 +13,7 @@ import { selectAll } from 'unist-util-select';
13
13
 
14
14
  // Compute the meta information for the section
15
15
  function computeMeta(section) {
16
- return selectAll('yaml', section).reduce((prev, { payload }) => Object.assign(prev, payload), {});
16
+ return selectAll('yaml', section).reduce((prev, { payload }) => Object.assign(prev, payload), Object.create(null));
17
17
  }
18
18
 
19
19
  /**
package/src/utils/auth.js CHANGED
@@ -16,12 +16,14 @@ import {
16
16
  import { clearAuthCookie, getAuthCookie, setAuthCookie } from './auth-cookie.js';
17
17
 
18
18
  import idpMicrosoft from './idp-configs/microsoft.js';
19
+ import idpAdmin from './idp-configs/admin.js';
19
20
 
20
21
  // eslint-disable-next-line import/no-unresolved
21
22
  import cryptoImpl from '#crypto';
22
23
 
23
24
  export const IDPS = [
24
25
  idpMicrosoft,
26
+ idpAdmin,
25
27
  ];
26
28
 
27
29
  const AUTH_REDIRECT_URL = 'https://login.hlx.page/.auth';
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2022 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ /**
14
+ * virtual idp config for the admin service
15
+ */
16
+ export default {
17
+ name: 'admin',
18
+ client: (state) => ({
19
+ clientId: state.env.HLX_SITE_APP_AZURE_CLIENT_ID,
20
+ }),
21
+ validateIssuer: (iss) => iss === 'https://admin.hlx.page/',
22
+ discovery: {
23
+ jwks_uri: 'https://admin.hlx.page/auth/discovery/keys',
24
+ },
25
+ };
@@ -48,7 +48,7 @@ function toLowerKeys(obj) {
48
48
  return Object.keys(obj).reduce((prev, key) => {
49
49
  prev[key.toLowerCase()] = obj[key];
50
50
  return prev;
51
- }, {});
51
+ }, Object.create(null));
52
52
  }
53
53
 
54
54
  /**
@@ -91,7 +91,7 @@ export class Modifiers {
91
91
  * @returns {object} An object containing an array of key/value pairs for every glob
92
92
  */
93
93
  static fromModifierSheet(sheet, keyFilter = () => true) {
94
- const res = {};
94
+ const res = Object.create(null);
95
95
  for (let row of sheet) {
96
96
  row = toLowerKeys(row);
97
97
  const {
@@ -140,7 +140,7 @@ export class Modifiers {
140
140
  * @return {object} the modifier
141
141
  */
142
142
  getModifiers(path) {
143
- const modifiers = {};
143
+ const modifiers = Object.create(null);
144
144
  for (const { pat, mods } of this.modifiers) {
145
145
  if (pat === path || (pat instanceof RegExp && pat.test(path))) {
146
146
  for (const { key, value } of mods) {
@@ -41,7 +41,7 @@ function getAttributes(section) {
41
41
  // Add system properties as data-hlx-*
42
42
  const attributes = attributeKeys
43
43
  .filter((k) => SYSTEM_HTML_ATTRIBUTES.indexOf(k) > -1)
44
- .reduce((result, attr) => Object.assign(result, { [`data-${HELIX_NAMESPACE}${attr}`]: toHtmlAttribute(section.meta[attr]) }), {});
44
+ .reduce((result, attr) => Object.assign(result, { [`data-${HELIX_NAMESPACE}${attr}`]: toHtmlAttribute(section.meta[attr]) }), Object.create(null));
45
45
  return attributeKeys
46
46
  .filter((k) => [...SYSTEM_HTML_ATTRIBUTES, ...SYSTEM_META_PROPERTIES].indexOf(k) === -1)
47
47
  .reduce((result, attr) => {