From 04ea8bb8a035382de078d082889c8fdfd48479f8 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Tue, 2 Feb 2021 16:07:40 -0800 Subject: [PATCH] fix(deps): missing uuid from plugins #529 Adds the missing dependency "uuid" to the packages where applicable. Also updates the import syntax in packages/cactus-plugin-consortium-manual/src/main/typescript/consortium/get-node-jws-endpoint-v1.ts which appears to make a difference? Fixes #529 Signed-off-by: Peter Somogyvari --- .../cactus-plugin-consortium-manual/package-lock.json | 11 +++++++++++ packages/cactus-plugin-consortium-manual/package.json | 6 ++++-- .../typescript/consortium/get-node-jws-endpoint-v1.ts | 4 ++-- .../cactus-plugin-keychain-memory/package-lock.json | 11 +++++++++++ packages/cactus-plugin-keychain-memory/package.json | 6 ++++-- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/packages/cactus-plugin-consortium-manual/package-lock.json b/packages/cactus-plugin-consortium-manual/package-lock.json index 09066d1875..29c4e8c649 100644 --- a/packages/cactus-plugin-consortium-manual/package-lock.json +++ b/packages/cactus-plugin-consortium-manual/package-lock.json @@ -136,6 +136,12 @@ "@types/mime": "*" } }, + "@types/uuid": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "dev": true + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -963,6 +969,11 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/packages/cactus-plugin-consortium-manual/package.json b/packages/cactus-plugin-consortium-manual/package.json index 59e2007c5b..c042bdcac6 100644 --- a/packages/cactus-plugin-consortium-manual/package.json +++ b/packages/cactus-plugin-consortium-manual/package.json @@ -90,7 +90,8 @@ "json-stable-stringify": "1.0.1", "lodash": "4.17.19", "secp256k1": "4.0.1", - "typescript-optional": "2.0.1" + "typescript-optional": "2.0.1", + "uuid": "8.3.2" }, "devDependencies": { "@types/express": "4.17.8", @@ -98,6 +99,7 @@ "@types/json-stable-stringify": "1.0.32", "@types/lodash": "4.14.158", "@types/multer": "1.4.3", - "@types/secp256k1": "4.0.1" + "@types/secp256k1": "4.0.1", + "@types/uuid": "8.3.0" } } diff --git a/packages/cactus-plugin-consortium-manual/src/main/typescript/consortium/get-node-jws-endpoint-v1.ts b/packages/cactus-plugin-consortium-manual/src/main/typescript/consortium/get-node-jws-endpoint-v1.ts index e5763d2912..f8114f8c31 100644 --- a/packages/cactus-plugin-consortium-manual/src/main/typescript/consortium/get-node-jws-endpoint-v1.ts +++ b/packages/cactus-plugin-consortium-manual/src/main/typescript/consortium/get-node-jws-endpoint-v1.ts @@ -1,4 +1,4 @@ -import uuid from "uuid"; +import { v4 as uuidv4 } from "uuid"; import { Express, Request, Response } from "express"; import { JWS, JWK } from "jose"; import jsonStableStringify from "json-stable-stringify"; @@ -100,7 +100,7 @@ export class GetNodeJwsEndpoint implements IWebServiceEndpoint { const payloadJson = jsonStableStringify(payloadObject); const _protected = { iat: Date.now(), - jti: uuid.v4(), + jti: uuidv4(), iss: "Hyperledger Cactus", }; // TODO: double check if this casting is safe (it is supposed to be) diff --git a/packages/cactus-plugin-keychain-memory/package-lock.json b/packages/cactus-plugin-keychain-memory/package-lock.json index 6adb61a301..b9dc24ea1c 100644 --- a/packages/cactus-plugin-keychain-memory/package-lock.json +++ b/packages/cactus-plugin-keychain-memory/package-lock.json @@ -10,6 +10,12 @@ "integrity": "sha512-1TQNDJvIKlgYXGNIABfgFp9y0FziDpuGrd799Q5RcnsDu+krD+eeW/0Fs5PHARvWWFelOhIG2OPCo6KbadBM4A==", "dev": true }, + "@types/uuid": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", + "dev": true + }, "hoek": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", @@ -50,6 +56,11 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/typescript-optional/-/typescript-optional-2.0.1.tgz", "integrity": "sha512-xuwmqsCjE4OeeMKxbNX3jjNcISGzYh5Q9R1rM5OyxEVNIr94CB5llCkfKW+1nZTKbbUV0axN3QAUuX2fus/DhQ==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" } } } diff --git a/packages/cactus-plugin-keychain-memory/package.json b/packages/cactus-plugin-keychain-memory/package.json index d2e29f05a1..316e2c218a 100644 --- a/packages/cactus-plugin-keychain-memory/package.json +++ b/packages/cactus-plugin-keychain-memory/package.json @@ -81,9 +81,11 @@ "@hyperledger/cactus-common": "0.3.0", "@hyperledger/cactus-core-api": "0.3.0", "joi": "14.3.1", - "typescript-optional": "2.0.1" + "typescript-optional": "2.0.1", + "uuid": "8.3.2" }, "devDependencies": { - "@types/joi": "14.3.4" + "@types/joi": "14.3.4", + "@types/uuid": "8.3.0" } }