@commercetools-backend/express 21.8.0 → 21.10.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.
@@ -7,6 +7,7 @@ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator
7
7
  var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
8
8
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
9
9
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
10
+ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
10
11
  var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
11
12
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
12
13
  var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
@@ -28,6 +29,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
28
29
  var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
29
30
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
30
31
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
32
+ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
31
33
  var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
32
34
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
33
35
  var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
@@ -239,12 +241,12 @@ function createSessionAuthVerifier(options) {
239
241
 
240
242
  requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
241
243
 
242
- if (requestUrlPath) {
244
+ if (!(!requestUrlPath || !_startsWithInstanceProperty__default["default"](requestUrlPath).call(requestUrlPath, '/'))) {
243
245
  _context3.next = 7;
244
246
  break;
245
247
  }
246
248
 
247
- throw new Error('Invalid request URI path. Please make sure that the `request` object has either a property `originalUrl` or `url`. If not, you should implement the `getRequestUrl` function. More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token');
249
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
248
250
 
249
251
  case 7:
250
252
  audience = getConfiguredAudience(options, requestUrlPath);
@@ -7,6 +7,7 @@ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator
7
7
  var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
8
8
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
9
9
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
10
+ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
10
11
  var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
11
12
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
12
13
  var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
@@ -28,6 +29,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
28
29
  var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
29
30
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
30
31
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
32
+ var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
31
33
  var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
32
34
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
33
35
  var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
@@ -239,12 +241,12 @@ function createSessionAuthVerifier(options) {
239
241
 
240
242
  requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
241
243
 
242
- if (requestUrlPath) {
244
+ if (!(!requestUrlPath || !_startsWithInstanceProperty__default["default"](requestUrlPath).call(requestUrlPath, '/'))) {
243
245
  _context3.next = 7;
244
246
  break;
245
247
  }
246
248
 
247
- throw new Error('Invalid request URI path. Please make sure that the `request` object has either a property `originalUrl` or `url`. If not, you should implement the `getRequestUrl` function. More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token');
249
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
248
250
 
249
251
  case 7:
250
252
  audience = getConfiguredAudience(options, requestUrlPath);
@@ -3,6 +3,7 @@ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerat
3
3
  import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
4
4
  import _URL from '@babel/runtime-corejs3/core-js-stable/url';
5
5
  import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
6
+ import _startsWithInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
6
7
  import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
7
8
  import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
8
9
  import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
@@ -216,12 +217,12 @@ function createSessionAuthVerifier(options) {
216
217
 
217
218
  requestUrlPath = options.getRequestUrl ? options.getRequestUrl(request) : (_request$originalUrl = request.originalUrl) !== null && _request$originalUrl !== void 0 ? _request$originalUrl : request.url;
218
219
 
219
- if (requestUrlPath) {
220
+ if (!(!requestUrlPath || !_startsWithInstanceProperty(requestUrlPath).call(requestUrlPath, '/'))) {
220
221
  _context3.next = 7;
221
222
  break;
222
223
  }
223
224
 
224
- throw new Error('Invalid request URI path. Please make sure that the `request` object has either a property `originalUrl` or `url`. If not, you should implement the `getRequestUrl` function. More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token');
225
+ throw new Error("Invalid request URI path \"".concat(requestUrlPath, "\". Please make sure that the \"request\" object has either a property \"originalUrl\" or \"url\". If not, you should implement the \"getRequestUrl\" function and make sure to return a valid URI path value starting with \"/\". More info at https://docs.commercetools.com/custom-applications/concepts/integrate-with-your-own-api#validating-the-json-web-token"));
225
226
 
226
227
  case 7:
227
228
  audience = getConfiguredAudience(options, requestUrlPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-backend/express",
3
- "version": "21.8.0",
3
+ "version": "21.10.0",
4
4
  "description": "Zero-config HTTP server as Express.js to facilitate development",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -18,18 +18,18 @@
18
18
  "module": "dist/commercetools-backend-express.esm.js",
19
19
  "files": ["dist", "package.json", "LICENSE", "README.md"],
20
20
  "dependencies": {
21
- "@babel/runtime": "^7.17.9",
22
- "@babel/runtime-corejs3": "^7.17.9",
23
- "@types/node": "16.11.33",
21
+ "@babel/runtime": "^7.18.6",
22
+ "@babel/runtime-corejs3": "^7.18.6",
23
+ "@types/node": "^16.11.33",
24
24
  "express": "4.18.1",
25
25
  "express-jwt": "7.7.0",
26
26
  "jwks-rsa": "2.1.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@tsconfig/node16": "^1.0.2",
29
+ "@tsconfig/node16": "^1.0.3",
30
30
  "@types/express-unless": "^0.5.3",
31
31
  "@types/jsonwebtoken": "^8.5.8",
32
32
  "jose": "2.0.5",
33
- "msw": "0.39.2"
33
+ "msw": "0.44.0"
34
34
  }
35
35
  }