From 5b8a39064fb04342ce9791618f918cca544e4958 Mon Sep 17 00:00:00 2001 From: Tyler Minard Date: Tue, 2 Apr 2024 10:38:25 -0400 Subject: [PATCH] Fix incorrect issuer IDs for GrottoNetworking. --- implementations/GrottoNetworking.json | 4 ++-- test/implementations.spec.js | 29 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/implementations/GrottoNetworking.json b/implementations/GrottoNetworking.json index ef1b6b6..a2b60be 100644 --- a/implementations/GrottoNetworking.json +++ b/implementations/GrottoNetworking.json @@ -2,13 +2,13 @@ "name": "Grotto Networking", "implementation": "Grotto Selective Disclosure Libraries", "issuers": [{ - "id": "did:key:zDnaepBuvsQ8cpsWrVKw8fbpGpvPeNSjVPTWoq6cRqaYzBKVP#zDnaepBuvsQ8cpsWrVKw8fbpGpvPeNSjVPTWoq6cRqaYzBKVP", + "id": "did:key:zDnaepBuvsQ8cpsWrVKw8fbpGpvPeNSjVPTWoq6cRqaYzBKVP", "endpoint": "https://ecdsa-sd.grotto-networking.com/credentials/issue", "tags": ["ecdsa-sd-2023"], "supportedEcdsaKeyTypes": ["P-256"] }, { - "id": "did:key:zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ#zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ", + "id": "did:key:zUC7DerdEmfZ8f4pFajXgGwJoMkV1ofMTmEG5UoNvnWiPiLuGKNeqgRpLH2TV4Xe5mJ2cXV76gRN7LFQwapF1VFu6x2yrr5ci1mXqC1WNUrnHnLgvfZfMH7h6xP6qsf9EKRQrPQ", "endpoint": "https://ecdsa-sd.grotto-networking.com/BBS/credentials/issue", "tags": ["bbs-2023"] }], diff --git a/test/implementations.spec.js b/test/implementations.spec.js index 1ab5544..94da07b 100644 --- a/test/implementations.spec.js +++ b/test/implementations.spec.js @@ -13,4 +13,33 @@ describe('Loading implementations', () => { it('result in no errors.', async () => { should.exist(allImplementations); }); + + describe('Implementations using DID:key identifiers', () => { + allImplementations.forEach(implementation => { + const {issuers, verifiers} = implementation; + + const isDidKeyFilter = ({settings: {id}}) => + id && id.startsWith('did:key'); + + describe(implementation.settings.name, () => { + issuers.filter(isDidKeyFilter) + .map(({settings: {id}}, index) => { + describe(`issuer[${index}].id`, () => { + it('should not specify a fragment', () => { + chai.expect(id).not.match(/#/); + }); + }); + }); + + verifiers.filter(isDidKeyFilter) + .map(({settings: {id}}, index) => { + describe(`verifier[${index}].id`, () => { + it('should not specify a fragment', () => { + chai.expect(id).not.match(/#/); + }); + }); + }); + }); + }); + }); });