From d75ecb62ccfe9ccaeb7013ef7e15331e7ddf8386 Mon Sep 17 00:00:00 2001 From: DaevMithran <61043607+DaevMithran@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:19:21 +0530 Subject: [PATCH] fix: Jsonld errors in did document (#378) * fix: Jsonld errors in did document * Removed redundant --------- Co-authored-by: Tasos Derisiotis <50984242+Eengineer1@users.noreply.github.com> --- src/modules/did.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/did.ts b/src/modules/did.ts index d8fb3456..42fa2130 100644 --- a/src/modules/did.ts +++ b/src/modules/did.ts @@ -45,6 +45,7 @@ export const contexts = { W3CSuiteEd255192020: 'https://w3id.org/security/suites/ed25519-2020/v1', W3CSuiteEd255192018: 'https://w3id.org/security/suites/ed25519-2018/v1', W3CSuiteJws2020: 'https://w3id.org/security/suites/jws-2020/v1', + DIFDIDConfiguration: 'https://identity.foundation/.well-known/did-configuration/v1', } as const; export const protobufLiterals = { @@ -545,6 +546,12 @@ export class DIDModule extends AbstractCheqdSDKModule { }); const context = (function () { + if ( + protobufDidDocument.service.length && + !protobufDidDocument.context.includes(contexts.DIFDIDConfiguration) + ) + protobufDidDocument.context.push(contexts.DIFDIDConfiguration); + if (protobufDidDocument.context.includes(contexts.W3CDIDv1)) return protobufDidDocument.context; return [contexts.W3CDIDv1, ...protobufDidDocument.context];