From 5a9cda5547f354edd61ae2226228535ca60660df Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Fri, 29 Dec 2023 19:59:46 -0500 Subject: [PATCH 1/5] Switch back to DB's jsonld and http-client libs. --- CHANGELOG.md | 6 ++++++ lib/ProofSet.js | 2 +- lib/purposes/ControllerProofPurpose.js | 2 +- lib/suites/LinkedDataSignature.js | 2 +- package.json | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 166e1410..9ecd6990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # jsonld-signatures ChangeLog +## 10.0.0 - + +### Changed +- Switch back to DB's `jsonld` and `http-client`. +- Switch to Sphereon's fork `@sphereon/isomorphic-webclient` + ## 9.4.0 - 2024-01-23 ### Changed - **BREAKING**: Removed deprecated `expansionMap` param. Making this a minor diff --git a/lib/ProofSet.js b/lib/ProofSet.js index 35259f86..653e3c0d 100644 --- a/lib/ProofSet.js +++ b/lib/ProofSet.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('./constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const {extendContextLoader, strictDocumentLoader} = require('./documentLoader'); const {serializeError} = require('serialize-error'); diff --git a/lib/purposes/ControllerProofPurpose.js b/lib/purposes/ControllerProofPurpose.js index 8e0d93c8..3b7bc196 100644 --- a/lib/purposes/ControllerProofPurpose.js +++ b/lib/purposes/ControllerProofPurpose.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const ProofPurpose = require('./ProofPurpose'); // DID documents can be specially optimized diff --git a/lib/suites/LinkedDataSignature.js b/lib/suites/LinkedDataSignature.js index 15f7e904..19860429 100644 --- a/lib/suites/LinkedDataSignature.js +++ b/lib/suites/LinkedDataSignature.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const util = require('../util'); const {sha256digest} = require('../sha256digest'); const LinkedDataProof = require('./LinkedDataProof'); diff --git a/package.json b/package.json index ddb0f2f7..90706b54 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "@digitalbazaar/security-context": "^1.0.0", - "@digitalcredentials/jsonld": "^6.0.0", + "jsonld": "digitalcredentials/jsonld.js#react-native", "fast-text-encoding": "^1.0.3", "isomorphic-webcrypto": "^2.3.8", "serialize-error": "^8.0.1" From e56d17dbbfc272469bca3ccb527ed2c42fe953f2 Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Fri, 29 Dec 2023 20:17:01 -0500 Subject: [PATCH 2/5] Remove expansionMap (deprecated). --- lib/ProofSet.js | 1 + lib/purposes/ProofPurpose.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ProofSet.js b/lib/ProofSet.js index 653e3c0d..f0607dfc 100644 --- a/lib/ProofSet.js +++ b/lib/ProofSet.js @@ -116,6 +116,7 @@ module.exports = class ProofSet { } else { documentLoader = strictDocumentLoader; } + try { // shallow copy to allow for removal of proof set prior to canonize document = {...document}; diff --git a/lib/purposes/ProofPurpose.js b/lib/purposes/ProofPurpose.js index ff2c7399..d8c331fb 100644 --- a/lib/purposes/ProofPurpose.js +++ b/lib/purposes/ProofPurpose.js @@ -73,7 +73,7 @@ module.exports = class ProofPurpose { * @return {Promise} resolves to the proof instance (in the * `constants.SECURITY_CONTEXT_URL`. */ - async update(proof, {/*document, suite, documentLoader */}) { + async update(proof, {/*document, suite, documentLoader*/}) { proof.proofPurpose = this.term; return proof; } diff --git a/package.json b/package.json index 90706b54..1639fb06 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "@digitalbazaar/security-context": "^1.0.0", - "jsonld": "digitalcredentials/jsonld.js#react-native", + "jsonld": "digitalcredentials/jsonld.js#update", "fast-text-encoding": "^1.0.3", "isomorphic-webcrypto": "^2.3.8", "serialize-error": "^8.0.1" From eb537278c886573bacc4dbbb327ade4d312d2320 Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Fri, 29 Dec 2023 23:50:07 -0500 Subject: [PATCH 3/5] Revert jsold. --- lib/ProofSet.js | 2 +- lib/purposes/ControllerProofPurpose.js | 2 +- lib/suites/LinkedDataSignature.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ProofSet.js b/lib/ProofSet.js index f0607dfc..02097bff 100644 --- a/lib/ProofSet.js +++ b/lib/ProofSet.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('./constants'); -const jsonld = require('jsonld'); +const jsonld = require('@digitalcredentials/jsonld'); const {extendContextLoader, strictDocumentLoader} = require('./documentLoader'); const {serializeError} = require('serialize-error'); diff --git a/lib/purposes/ControllerProofPurpose.js b/lib/purposes/ControllerProofPurpose.js index 3b7bc196..8e0d93c8 100644 --- a/lib/purposes/ControllerProofPurpose.js +++ b/lib/purposes/ControllerProofPurpose.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('jsonld'); +const jsonld = require('@digitalcredentials/jsonld'); const ProofPurpose = require('./ProofPurpose'); // DID documents can be specially optimized diff --git a/lib/suites/LinkedDataSignature.js b/lib/suites/LinkedDataSignature.js index 19860429..15f7e904 100644 --- a/lib/suites/LinkedDataSignature.js +++ b/lib/suites/LinkedDataSignature.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('jsonld'); +const jsonld = require('@digitalcredentials/jsonld'); const util = require('../util'); const {sha256digest} = require('../sha256digest'); const LinkedDataProof = require('./LinkedDataProof'); diff --git a/package.json b/package.json index 1639fb06..4e1eea54 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "@digitalbazaar/security-context": "^1.0.0", - "jsonld": "digitalcredentials/jsonld.js#update", + "@digitalcredentials/jsonld": "digitalcredentials/jsonld.js#update", "fast-text-encoding": "^1.0.3", "isomorphic-webcrypto": "^2.3.8", "serialize-error": "^8.0.1" From 2efa350a4303c67181f50beb23505b18e3db33da Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Fri, 26 Jan 2024 20:43:12 -0500 Subject: [PATCH 4/5] Update to DB jsonld.js dep. --- lib/ProofSet.js | 2 +- lib/purposes/ControllerProofPurpose.js | 2 +- lib/suites/LinkedDataSignature.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ProofSet.js b/lib/ProofSet.js index 02097bff..f0607dfc 100644 --- a/lib/ProofSet.js +++ b/lib/ProofSet.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('./constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const {extendContextLoader, strictDocumentLoader} = require('./documentLoader'); const {serializeError} = require('serialize-error'); diff --git a/lib/purposes/ControllerProofPurpose.js b/lib/purposes/ControllerProofPurpose.js index 8e0d93c8..3b7bc196 100644 --- a/lib/purposes/ControllerProofPurpose.js +++ b/lib/purposes/ControllerProofPurpose.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const ProofPurpose = require('./ProofPurpose'); // DID documents can be specially optimized diff --git a/lib/suites/LinkedDataSignature.js b/lib/suites/LinkedDataSignature.js index 15f7e904..19860429 100644 --- a/lib/suites/LinkedDataSignature.js +++ b/lib/suites/LinkedDataSignature.js @@ -4,7 +4,7 @@ 'use strict'; const constants = require('../constants'); -const jsonld = require('@digitalcredentials/jsonld'); +const jsonld = require('jsonld'); const util = require('../util'); const {sha256digest} = require('../sha256digest'); const LinkedDataProof = require('./LinkedDataProof'); diff --git a/package.json b/package.json index 4e1eea54..633f9d1d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "@digitalbazaar/security-context": "^1.0.0", - "@digitalcredentials/jsonld": "digitalcredentials/jsonld.js#update", + "@digitalbazaar/jsonld": "digitalcredentials/jsonld.js#react-native", "fast-text-encoding": "^1.0.3", "isomorphic-webcrypto": "^2.3.8", "serialize-error": "^8.0.1" From c03f7e8e315edb0b1919a2867a363bfbe9569881 Mon Sep 17 00:00:00 2001 From: Dmitri Zagidulin Date: Wed, 7 Feb 2024 14:49:29 -0500 Subject: [PATCH 5/5] Switch to Sphereon isomorphic-webcrypto fork. --- lib/sha256digest-reactnative.js | 2 +- package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sha256digest-reactnative.js b/lib/sha256digest-reactnative.js index d4012ad8..a692dd7c 100644 --- a/lib/sha256digest-reactnative.js +++ b/lib/sha256digest-reactnative.js @@ -3,7 +3,7 @@ */ 'use strict'; -const crypto = require('isomorphic-webcrypto'); +const crypto = require('@sphereon/isomorphic-webcrypto'); require('fast-text-encoding'); module.exports = { diff --git a/package.json b/package.json index 633f9d1d..87011cf8 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ "lib/**/*.js" ], "dependencies": { + "jsonld": "digitalcredentials/jsonld.js#react-native", "@digitalbazaar/security-context": "^1.0.0", - "@digitalbazaar/jsonld": "digitalcredentials/jsonld.js#react-native", + "@sphereon/isomorphic-webcrypto": "^2.4.0-unstable.4", "fast-text-encoding": "^1.0.3", - "isomorphic-webcrypto": "^2.3.8", "serialize-error": "^8.0.1" }, "devDependencies": { @@ -68,7 +68,7 @@ "crypto": false, "./lib/sha256digest.js": "./lib/sha256digest-browser.js", "fast-text-encoding": false, - "isomorphic-webcrypto": false + "@sphereon/isomorphic-webcrypto": false }, "react-native": { "crypto": false,