Skip to content

Commit

Permalink
fix: WithExpectedDataIntegrityFields (#1422)
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Qutishat <[email protected]>
  • Loading branch information
fqutishat authored Sep 13, 2023
1 parent 9d616ea commit ad1d015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/service/verifycredential/verifycredential_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (s *Service) parseAndVerifyVC(vcBytes []byte, isJWT bool) (*verifiable.Cred
// Use empty domain and challenge in order to skip the validation.
// See usage of vcInVPValidation variable in ValidateCredentialProof method.
// TODO: define verifier purpose field.
verifiable.WithExpectedDataIntegrityFields(crypto.Authentication, "", ""),
verifiable.WithExpectedDataIntegrityFields(crypto.AssertionMethod, "", ""),
}

if !isJWT {
Expand Down
4 changes: 2 additions & 2 deletions pkg/service/verifycredential/verifycredential_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ func Test_DataIntegrity_SignVerify(t *testing.T) {

didResolver := &vdrmock.VDRegistry{
ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) {
return makeMockDIDResolution(signingDID, verificationMethod, did.Authentication), nil
return makeMockDIDResolution(signingDID, verificationMethod, did.AssertionMethod), nil
}}

signerSuite := ecdsa2019.NewSignerInitializer(&ecdsa2019.SignerInitializerOptions{
Expand All @@ -795,7 +795,7 @@ func Test_DataIntegrity_SignVerify(t *testing.T) {

signContext := &verifiable.DataIntegrityProofContext{
SigningKeyID: signingDID + vmID,
ProofPurpose: crypto.Authentication,
ProofPurpose: crypto.AssertionMethod,
CryptoSuite: ecdsa2019.SuiteType,
Created: nil,
Domain: "mock-domain",
Expand Down

0 comments on commit ad1d015

Please sign in to comment.