From bd35650b067b399d7bc913155ea57d00276e0bb8 Mon Sep 17 00:00:00 2001 From: Eric Smekens Date: Tue, 6 Oct 2020 20:42:53 +0200 Subject: [PATCH] Updated uuid for performance improvement --- package-lock.json | 8 ++++---- package.json | 2 +- src/JwtGenerator.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05e13a17..9e9a799d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@vonage/server-sdk", - "version": "2.10.1", + "version": "2.10.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8711,9 +8711,9 @@ "dev": true }, "uuid": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz", + "integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==" }, "verror": { "version": "1.10.0", diff --git a/package.json b/package.json index c368ae42..a6cc8861 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "dependencies": { "jsonwebtoken": "^8.4.0", "request": "^2.88.2", - "uuid": "^2.0.2" + "uuid": "^8.3.0" }, "license": "Apache 2.0" } diff --git a/src/JwtGenerator.js b/src/JwtGenerator.js index 3c99d168..088a0e5b 100644 --- a/src/JwtGenerator.js +++ b/src/JwtGenerator.js @@ -1,4 +1,4 @@ -import uuid from "uuid"; +import { v1 as uuidv1 } from "uuid"; import jwt from "jsonwebtoken"; class JwtGenerator { @@ -22,7 +22,7 @@ class JwtGenerator { var toSign = { iat: claims.issuedAt || parseInt(Date.now() / 1000, 10), - jti: claims.jti || uuid.v1() + jti: claims.jti || uuidv1() }; Object.keys(claims).forEach(key => { toSign[key] = claims[key];