From dfeb1b5ba5f1df86fdde941ebde4ed2196c1e267 Mon Sep 17 00:00:00 2001 From: DaevMithran Date: Wed, 16 Oct 2024 13:48:41 +0530 Subject: [PATCH] Add signature dkgOption validation --- src/agent/ICheqd.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/agent/ICheqd.ts b/src/agent/ICheqd.ts index 1de5286..635d0ac 100644 --- a/src/agent/ICheqd.ts +++ b/src/agent/ICheqd.ts @@ -6649,6 +6649,11 @@ export class Cheqd implements IAgentPlugin { ); } + // validate dkgOptions + if (!options?.topArgs?.dkgOptions || !options.topArgs?.dkgOptions?.capacityDelegationAuthSignature) { + throw new Error('[did-provider-cheqd]: dkgOptions is required'); + } + // fetch status list 2021 const publishedList = (await Cheqd.fetchStatusList2021(credential)) as StatusList2021Revocation; @@ -6717,7 +6722,7 @@ export class Cheqd implements IAgentPlugin { thresholdEncryptionCiphertext, publishedList.metadata.statusListHash!, unifiedAccessControlConditions, - options?.topArgs?.dkgOptions?.capacityDelegationAuthSig + options?.topArgs?.dkgOptions?.capacityDelegationAuthSignature ); })() : await (async function () { @@ -6821,6 +6826,11 @@ export class Cheqd implements IAgentPlugin { ); } + // validate dkgOptions + if (!options?.topArgs?.dkgOptions || !options.topArgs?.dkgOptions?.capacityDelegationAuthSignature) { + throw new Error('[did-provider-cheqd]: dkgOptions is required'); + } + // fetch status list 2021 const publishedList = (await Cheqd.fetchStatusList2021(credential)) as StatusList2021Suspension; @@ -6885,7 +6895,7 @@ export class Cheqd implements IAgentPlugin { thresholdEncryptionCiphertext, publishedList.metadata.statusListHash!, unifiedAccessControlConditions, - options?.topArgs?.dkgOptions?.capacityDelegationAuthSig + options?.topArgs?.dkgOptions?.capacityDelegationAuthSignature ); })() : await (async function () {