Commit 96937030994de5bc19853ccd82d11f38cd80b47e

Authored by Adhidarma Hadiwinoto
1 parent 70df828c5a
Exists in master and in 1 other branch dev

XID using uniqid

Showing 3 changed files with 7 additions and 6 deletions Side-by-side Diff

lib/middlewares/common.js
1   -const uuidv1 = require('uuid/v1');
  1 +// const uuidv1 = require('uuid/v1');
  2 +const uniqid = require('uniqid');
2 3 const logger = require('komodo-sdk/logger');
3 4  
4 5 module.exports = function common(req, res, next) {
... ... @@ -7,7 +8,7 @@ module.exports = function common(req, res, next) {
7 8 return;
8 9 }
9 10  
10   - res.locals.xid = uuidv1();
  11 + res.locals.xid = uniqid();
11 12 res.locals.x_http_request_ts = new Date();
12 13  
13 14 logger.info(`Got request from ${res.locals.httpgetx_subsystem === 'CORE-CALLBACK' ? 'CORE' : 'PARTNER'}`, {
... ... @@ -3233,9 +3233,9 @@
3233 3233 }
3234 3234 },
3235 3235 "uniqid": {
3236   - "version": "5.0.3",
3237   - "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.0.3.tgz",
3238   - "integrity": "sha512-R2qx3X/LYWSdGRaluio4dYrPXAJACTqyUjuyXHoJLBUOIfmMcnYOyY2d6Y4clZcIz5lK6ZaI0Zzmm0cPfsIqzQ=="
  3236 + "version": "5.3.0",
  3237 + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.3.0.tgz",
  3238 + "integrity": "sha512-Jq8EzvAT8/CcLu8tzoSiylnzPkNhJJKpnMT964Dj1jI4pG4sKYP9aFVByNTp8KzMvYlW1Um63PCDqtOoujNzrA=="
3239 3239 },
3240 3240 "unpipe": {
3241 3241 "version": "1.0.0",
... ... @@ -34,7 +34,7 @@
34 34 "komodo-sdk": "git+https://gitlab.kodesumber.com/komodo/komodo-sdk.git",
35 35 "moment": "^2.24.0",
36 36 "request": "^2.88.0",
37   - "uniqid": "^5.0.3",
  37 + "uniqid": "^5.3.0",
38 38 "uuid": "^3.3.3"
39 39 }
40 40 }