From b060a3c9e2cb6f400de707ff0785565c006e333e Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 2 Oct 2024 21:15:26 -0400 Subject: [PATCH] Ensure VM ID is a string in `ControllerProofPurpose`. --- CHANGELOG.md | 6 ++++++ lib/purposes/ControllerProofPurpose.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8700bf38..0808b865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # jsonld-signatures ChangeLog +## 11.3.1 - 2024-10-dd + +### Fixed +- Ensure verification method ID is a string when checking controller + proof purpose. + ## 11.3.0 - 2024-08-01 ### Changed diff --git a/lib/purposes/ControllerProofPurpose.js b/lib/purposes/ControllerProofPurpose.js index 67226806..1e002861 100644 --- a/lib/purposes/ControllerProofPurpose.js +++ b/lib/purposes/ControllerProofPurpose.js @@ -70,6 +70,11 @@ module.exports = class ControllerProofPurpose extends ProofPurpose { } const {id: verificationId} = verificationMethod; + if(typeof verificationId !== 'string') { + throw new Error( + `Verification method ID "${verificationMethod.id}" ` + + 'must be a string.'); + } const {term, _termDefinedByDIDContext} = this; // if no `controller` specified, use verification method's