From aa541cb812643a6e768d184b6d39754aa789c46d Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Thu, 15 Feb 2024 09:18:39 -0500 Subject: [PATCH 1/2] Update JWK schema Signed-off-by: Frank Hinek --- json-schemas/jwk-verification-method.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/json-schemas/jwk-verification-method.json b/json-schemas/jwk-verification-method.json index d18353b33..25d41c947 100644 --- a/json-schemas/jwk-verification-method.json +++ b/json-schemas/jwk-verification-method.json @@ -14,7 +14,10 @@ "type": "string" }, "type": { - "const": "JsonWebKey2020" + "enum": [ + "JsonWebKey", + "JsonWebKey2020" + ] }, "controller": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/definitions/did" From b9813476ad89b13e6e4d77009f171b43f2a41564 Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Thu, 15 Feb 2024 09:22:01 -0500 Subject: [PATCH 2/2] Add test to validate JsonWebKey is supported Signed-off-by: Frank Hinek --- .../json-schemas/jwk-verification-method.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/validation/json-schemas/jwk-verification-method.spec.ts b/tests/validation/json-schemas/jwk-verification-method.spec.ts index cfa074386..70a0add4e 100644 --- a/tests/validation/json-schemas/jwk-verification-method.spec.ts +++ b/tests/validation/json-schemas/jwk-verification-method.spec.ts @@ -26,6 +26,17 @@ describe('JwkVerificationMethod', async () => { ).to.not.throw(); }); + it('should not throw an exception if verificationMethod uses \'JsonWebKey\' type', () => { + expect( + () => validateJsonSchema('JwkVerificationMethod', { + id : 'did:jank:alice#key1', + type : 'JsonWebKey', + controller : 'did:jank:alice', + publicKeyJwk : publicJwk + }) + ).to.not.throw(); + }); + it('should not throw if `id` does not have the DID as prefix', () => { expect( () => validateJsonSchema('JwkVerificationMethod', {