Skip to content

Commit

Permalink
feat: Support custom verification policies && domain (#287)
Browse files Browse the repository at this point in the history
* feat: Support custom verification policies

* feat: Add domain in verifyPresentation

---------

Co-authored-by: Tasos Derisiotis <50984242+Eengineer1@users.noreply.github.com>
  • Loading branch information
DaevMithran and Eengineer1 committed Jul 4, 2023
1 parent d653ac3 commit 403ec16
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/agent/ICheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import {
IDataStore,
IResolver,
W3CVerifiableCredential,
ICredentialVerifier
ICredentialVerifier,
VerificationPolicies
} from '@veramo/core'
import {
CheqdDIDProvider,
Expand Down Expand Up @@ -300,6 +301,7 @@ export interface ICheqdIssueSuspendableCredentialWithStatusList2021Args {

export interface ICheqdVerifyCredentialWithStatusList2021Args {
credential: W3CVerifiableCredential
policies?: VerificationPolicies
fetchList?: boolean
encryptedSymmetricKey?: string
options?: ICheqdStatusList2021Options
Expand All @@ -314,6 +316,8 @@ export interface ICheqdVerifyCredentialWithStatusList2021Args {

export interface ICheqdVerifyPresentationWithStatusList2021Args {
presentation: VerifiablePresentation
domain?: string
policies?: VerificationPolicies
fetchList?: boolean
encryptedSymmetricKey?: string
options?: ICheqdStatusList2021Options
Expand Down Expand Up @@ -1610,6 +1614,7 @@ export class Cheqd implements IAgentPlugin {
const verificationResult = await context.agent.verifyCredential({
credential: args.credential,
policies: {
...args.policies,
credentialStatus: false
}
} satisfies IVerifyCredentialArgs)
Expand Down Expand Up @@ -1639,7 +1644,9 @@ export class Cheqd implements IAgentPlugin {
// verify default policies
const verificationResult = await context.agent.verifyPresentation({
presentation: args.presentation,
domain: args.domain,
policies: {
...args.policies,
credentialStatus: false
}
} satisfies IVerifyPresentationArgs)
Expand Down

0 comments on commit 403ec16

Please sign in to comment.