Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
feat: create DI options aliases
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK committed Aug 22, 2023
1 parent 5b00069 commit a896181
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/doc/verifiable/verifiable.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package verifiable

import (
"crypto"
"github.com/hyperledger/aries-framework-go/component/models/dataintegrity"
"time"

jsonld "github.com/piprate/json-gold/ld"
Expand Down Expand Up @@ -127,6 +128,20 @@ func WithBaseContextValidation() CredentialOpt {
return verifiable.WithBaseContextValidation()
}

// WithDataIntegrityVerifier provides the Data Integrity verifier to use when
// the credential being processed has a Data Integrity proof.
func WithDataIntegrityVerifier(v *dataintegrity.Verifier) CredentialOpt {
return verifiable.WithDataIntegrityVerifier(v)

Check warning on line 134 in pkg/doc/verifiable/verifiable.go

View check run for this annotation

Codecov / codecov/patch

pkg/doc/verifiable/verifiable.go#L133-L134

Added lines #L133 - L134 were not covered by tests
}

// WithExpectedDataIntegrityFields validates that a Data Integrity proof has the
// given purpose, domain, and challenge. Empty purpose means the default,
// assertionMethod, will be expected. Empty domain and challenge will mean they
// are not checked.
func WithExpectedDataIntegrityFields(purpose, domain, challenge string) CredentialOpt {
return verifiable.WithExpectedDataIntegrityFields(purpose, domain, challenge)

Check warning on line 142 in pkg/doc/verifiable/verifiable.go

View check run for this annotation

Codecov / codecov/patch

pkg/doc/verifiable/verifiable.go#L141-L142

Added lines #L141 - L142 were not covered by tests
}

// WithBaseContextExtendedValidation validates that fields that are specified in base context are as specified.
// Additional fields are allowed.
func WithBaseContextExtendedValidation(customContexts, customTypes []string) CredentialOpt {
Expand Down

0 comments on commit a896181

Please sign in to comment.