@yopdev/dev-server 1.3.15 → 1.3.16

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.
@@ -78,7 +78,7 @@ var LambdaHttpProxy = /** @class */ (function () {
78
78
  (0, responses_1.internalServerError)(response, e.body);
79
79
  })];
80
80
  });
81
- }); }, function (e) { return e === exports.UNAUTHORIZED ? (0, responses_1.writeResponse)(response, 401, '') : Promise.reject(e); })];
81
+ }); }, function (e) { return e === exports.UNAUTHORIZED ? (0, responses_1.writeResponse)(response, 401, '') : (0, responses_1.internalServerError)(response, e); })];
82
82
  });
83
83
  }); });
84
84
  };
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapToLambdaEvent = exports.mapToLambdaSqsRecord = void 0;
4
- var logging_1 = require("@yopdev/logging");
5
4
  var url_1 = require("url");
6
- var LOGGER = logging_1.LoggerFactory.create('MAPPERS');
7
5
  var mapToLambdaSqsRecord = function (message) {
8
6
  if (!message.Body)
9
7
  throw new Error('message Body must be present');
@@ -31,7 +29,6 @@ function mapToLambdaEvent(req, requestBody) {
31
29
  var url = new url_1.URL(decodeURIComponent(req.url), "http://".concat(req.headers.host));
32
30
  var qsp = {};
33
31
  url.searchParams.forEach(function (v, k) { return (qsp[k] = v); });
34
- var claims = extractClaims(req);
35
32
  var headers = {};
36
33
  if (req.headers['content-type'])
37
34
  headers['content-type'] = req.headers['content-type'];
@@ -54,7 +51,7 @@ function mapToLambdaEvent(req, requestBody) {
54
51
  requestContext: {
55
52
  accountId: '',
56
53
  apiId: '',
57
- authorizer: { jwt: { claims: claims }, claims: claims },
54
+ authorizer: undefined,
58
55
  httpMethod: '',
59
56
  identity: {
60
57
  accessKey: '',
@@ -90,14 +87,3 @@ function mapToLambdaEvent(req, requestBody) {
90
87
  });
91
88
  }
92
89
  exports.mapToLambdaEvent = mapToLambdaEvent;
93
- function extractClaims(req) {
94
- var _a;
95
- var jwt = (_a = req.headers['authorization']) === null || _a === void 0 ? void 0 : _a.replace('Bearer ', '');
96
- try {
97
- return jwt ? JSON.parse(atob(jwt.split('.')[1])) : null;
98
- }
99
- catch (e) {
100
- LOGGER.warn('Invalid token, claims could not be extracted: %O', jwt);
101
- return undefined;
102
- }
103
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yopdev/dev-server",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "scripts": {
5
5
  "compile": "tsc",
6
6
  "pretest": "npm run compile",