Skip to content

Commit

Permalink
Add signature dkgOption validation
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Oct 16, 2024
1 parent 0958699 commit dfeb1b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/agent/ICheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit dfeb1b5

Please sign in to comment.