From 481707b787c3cc17551e446e206531908f7a1dfe Mon Sep 17 00:00:00 2001 From: eum602 Date: Sun, 15 Oct 2023 11:31:25 -0500 Subject: [PATCH 1/3] fix: make chainId be a valid hex value by padding left with one zero if necessary Signed-off-by: eum602 --- .../verifiable-credentials/verifiable.credentials.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/verifiable-credentials/verifiable.credentials.service.ts b/src/services/verifiable-credentials/verifiable.credentials.service.ts index e867a58..9efeda0 100644 --- a/src/services/verifiable-credentials/verifiable.credentials.service.ts +++ b/src/services/verifiable-credentials/verifiable.credentials.service.ts @@ -59,6 +59,7 @@ type assertionPublicKeyType = { hexPubKey: string; keyId: string }; type credentialFingerPrint = { hash: string; digest: string }; @Service() export class VerifiableCredentialService { + private readonly hex = require('base-x')('0123456789abcdef'); private readonly base58 = require('base-x')( '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' ); @@ -980,8 +981,10 @@ export class VerifiableCredentialService { Buffer.from(verificationRegistryContractAddress.replace('0x', ''), 'hex'), Buffer.from(publicDirectoryContractAddress.replace('0x', ''), 'hex'), Buffer.from(chainOfTrustContractAddress.replace('0x', ''), 'hex'), - Buffer.from(CHAIN_ID.replace('0x', ''), 'hex') + // eslint-disable-next-line max-len + this.hex.decode(CHAIN_ID.replace('0x', ''), 'hex') // the same as Buffer.from(evenHexWithout0x, 'hex') ]; + console.log('payload without checksum', payload); payload.push(this.checksum(payload)); return this.base58.encode(Buffer.concat(payload)); } From d093727adc5802c896e9c03f4e24d6311506905e Mon Sep 17 00:00:00 2001 From: eum602 Date: Sun, 15 Oct 2023 12:10:02 -0500 Subject: [PATCH 2/3] chore: update 'lacchain-trust' dependency version - 0.0.7 Signed-off-by: eum602 --- CHANGELOG.md | 6 ++++++ package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a19f8f..40a501e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.0.10 + +### Bug Fixes +* Fixes incorrect encoded value for 'domain' attribute in proof. +* Update lacchain trust dependency to version 0.0.7 (fix revoke jwk case) + ### 0.0.9 * Update verification Registry default contract address for OpenProtest network to '0x64CaA0fC7E0C1f051078da9525A31D00dB1F50eE' (since this considers isRevoked flag on queried for a digest issued by some entity) diff --git a/package.json b/package.json index 4cffd85..24a498d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lacpass-client", - "version": "0.0.9", + "version": "0.0.10", "description": "Rest api for lacpass Client", "license": "MIT", "scripts": { @@ -81,7 +81,7 @@ "form-data": "^4.0.0", "helmet": "^5.0.2", "jsonwebtoken": "^9.0.0", - "lacchain-trust": "^0.0.6", + "lacchain-trust": "^0.0.7", "morgan": "^1.10.0", "multer": "^1.4.4", "nodemailer": "^6.7.3", diff --git a/yarn.lock b/yarn.lock index 5b49b32..21830b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5790,10 +5790,10 @@ koa@^2.8.2: type-is "^1.6.16" vary "^1.1.2" -lacchain-identity@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/lacchain-identity/-/lacchain-identity-0.0.6.tgz#9f59a4a35d06d3c9a316dacd9606e09ae6c4837c" - integrity sha512-p250BxYpxe3/6CFGbicvAgOBkLLyl2XeImCmH869xpgZST4a45G35JkAc2z1nHAYIDfvPmnpsJqJsow5rYuzwg== +lacchain-identity@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/lacchain-identity/-/lacchain-identity-0.0.7.tgz#93b6f9bd7508070100347467278dbc3a76021ce4" + integrity sha512-zKorOuVV6Dip3LrLz0o8CVYsUuY2qDyYln7keG9AdaD5T8AidjSNzaVuh299oV4a66dGomSxV0jlGOVCw/qcRw== dependencies: "@lacchain/gas-model-provider" "^1.0.1" aws-sdk "^2.1116.0" @@ -5873,10 +5873,10 @@ lacchain-key-manager@^0.0.6: typescript-logging "^2.1.0" typescript-logging-log4ts-style "^2.1.0" -lacchain-trust@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/lacchain-trust/-/lacchain-trust-0.0.6.tgz#a049a3212c4be91c99ada046d33a3a6f3eb83783" - integrity sha512-He7vIEySgGHDDtc2UJRQ3XQhMROwDecUdLeOoYzybQpNgLZTFESLLG8s6BVsPNSWgZHUt+5qt3zmCN4avE2gXQ== +lacchain-trust@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/lacchain-trust/-/lacchain-trust-0.0.7.tgz#9cd89db2eea3d347f8d86879b54b89fcdce3029b" + integrity sha512-4n2VyH+mUbhMAKZjrqAibRcLoxAn+CDwc33Hf+IhVJ5e6TANlqPhGyjWs3tjTYFX/QvlAPXl2/c5MeEo5CWDYA== dependencies: "@lacchain/gas-model-provider" "^1.0.1" aws-sdk "^2.1116.0" @@ -5895,7 +5895,7 @@ lacchain-trust@^0.0.6: express-rate-limit "^6.3.0" helmet "^5.0.2" jsonwebtoken "^9.0.0" - lacchain-identity "^0.0.6" + lacchain-identity "^0.0.7" morgan "^1.10.0" multer "^1.4.4" nodemailer "^6.7.3" From 4c914101c3dd92c984ee6492cd99050444929eae Mon Sep 17 00:00:00 2001 From: eum602 Date: Tue, 17 Oct 2023 08:43:43 -0500 Subject: [PATCH 3/3] fix: remove unnecessary logs Signed-off-by: eum602 --- CHANGELOG.md | 2 +- package.json | 2 +- .../verifiable-credentials/verifiable.credentials.service.ts | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a501e..2afe47a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -### 0.0.10 +### 0.0.11 ### Bug Fixes * Fixes incorrect encoded value for 'domain' attribute in proof. diff --git a/package.json b/package.json index 24a498d..5ab09e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lacpass-client", - "version": "0.0.10", + "version": "0.0.11", "description": "Rest api for lacpass Client", "license": "MIT", "scripts": { diff --git a/src/services/verifiable-credentials/verifiable.credentials.service.ts b/src/services/verifiable-credentials/verifiable.credentials.service.ts index 9efeda0..2125489 100644 --- a/src/services/verifiable-credentials/verifiable.credentials.service.ts +++ b/src/services/verifiable-credentials/verifiable.credentials.service.ts @@ -984,7 +984,6 @@ export class VerifiableCredentialService { // eslint-disable-next-line max-len this.hex.decode(CHAIN_ID.replace('0x', ''), 'hex') // the same as Buffer.from(evenHexWithout0x, 'hex') ]; - console.log('payload without checksum', payload); payload.push(this.checksum(payload)); return this.base58.encode(Buffer.concat(payload)); }