@meru2802/aux-server 1.0.22 → 1.0.24

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.
@@ -1 +1 @@
1
- {"version":3,"file":"authMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware/authMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,gBAAgB,CAAC,EAAE,iBAAiB;IAIzC,QAAQ,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UA8KhE;IAEK,WAAW,GAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,MAAM,YAAY,KACjB,OAAO,CAAC,IAAI,CAAC,CAmFd;CACH"}
1
+ {"version":3,"file":"authMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware/authMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKlD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,gBAAgB,CAAC,EAAE,iBAAiB;IAIzC,QAAQ,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UAgLhE;IAEK,WAAW,GAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,MAAM,YAAY,KACjB,OAAO,CAAC,IAAI,CAAC,CAmFd;CACH"}
@@ -45,10 +45,13 @@ class AuthMiddleware extends BaseMiddleware_1.BaseMiddleware {
45
45
  constructor(serviceContainer) {
46
46
  super(serviceContainer);
47
47
  this.hmacAuth = (req, res, next) => {
48
+ var _a;
48
49
  try {
49
50
  const signature = req.headers["x-hmac-signature"];
50
51
  const timestamp = req.headers["x-hmac-timestamp"];
51
52
  const nonce = req.headers["x-hmac-nonce"];
53
+ const hostname = ((_a = req.headers.host) === null || _a === void 0 ? void 0 : _a.trim()) || req.hostname.trim();
54
+ console.log(`Request hostname: ${hostname}`);
52
55
  if (!signature || !timestamp || !nonce) {
53
56
  const unauthorizedResponse = {
54
57
  error: "UnauthorizedException",
@@ -134,7 +137,7 @@ class AuthMiddleware extends BaseMiddleware_1.BaseMiddleware {
134
137
  req.originalUrl,
135
138
  timestamp,
136
139
  nonce,
137
- `content-type:application/json;host:${req.hostname}`,
140
+ `content-type:application/json;host:${hostname}`,
138
141
  bodyHash,
139
142
  ].join("\n");
140
143
  console.log(`HMAC Message: ${message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meru2802/aux-server",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Nexus EPM auxillary server to facilitate additional functionality required by Scogo Iceberg",
5
5
  "main": "index.js",
6
6
  "files": [