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

feat: create DI options aliases #3623

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/doc/verifiable/verifiable.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/hyperledger/aries-framework-go/spi/kms"
"github.com/hyperledger/aries-framework-go/spi/vdr"

"github.com/hyperledger/aries-framework-go/component/models/dataintegrity"
"github.com/hyperledger/aries-framework-go/component/models/did"
"github.com/hyperledger/aries-framework-go/component/models/sdjwt/common"
"github.com/hyperledger/aries-framework-go/component/models/sdjwt/holder"
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)
}

// 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)
}

// 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