From 1628cb6d532f5df6dddcb92b03d154826f70fa6a Mon Sep 17 00:00:00 2001 From: Andrii Holovko Date: Tue, 23 Jul 2024 18:07:42 +0300 Subject: [PATCH] feat(sdk): support for oid4vp ID2 version (#782) Signed-off-by: Andrii Holovko --- cmd/wallet-sdk-gomobile/go.mod | 2 +- cmd/wallet-sdk-gomobile/go.sum | 4 +- go.mod | 5 +- go.sum | 10 +- pkg/openid4vp/openid4vp.go | 134 +++++++++++++++------ pkg/openid4vp/openid4vp_test.go | 65 +++------- pkg/openid4vp/request_object.go | 51 +++++--- pkg/openid4vp/test_data/request_object.jwt | 2 +- pkg/openid4vp/test_data/verifier_did.data | 1 - pkg/openid4vp/tokens.go | 12 +- test/integration/attestation/go.mod | 2 +- test/integration/attestation/go.sum | 10 +- test/integration/cli/go.sum | 7 +- test/integration/fixtures/.env | 4 +- test/integration/go.mod | 2 +- test/integration/go.sum | 4 +- test/integration/pkg/helpers/openid4ci.go | 14 +-- test/integration/trustregistry/go.mod | 2 +- test/integration/trustregistry/go.sum | 10 +- 19 files changed, 201 insertions(+), 140 deletions(-) delete mode 100644 pkg/openid4vp/test_data/verifier_did.data diff --git a/cmd/wallet-sdk-gomobile/go.mod b/cmd/wallet-sdk-gomobile/go.mod index 47b9306c..d81245e1 100644 --- a/cmd/wallet-sdk-gomobile/go.mod +++ b/cmd/wallet-sdk-gomobile/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.8.2 github.com/trustbloc/did-go v1.2.1 github.com/trustbloc/kms-go v1.1.2 - github.com/trustbloc/vc-go v1.1.2 + github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 github.com/trustbloc/wallet-sdk v0.0.0-00010101000000-000000000000 ) diff --git a/cmd/wallet-sdk-gomobile/go.sum b/cmd/wallet-sdk-gomobile/go.sum index 91150e91..4176c5f8 100644 --- a/cmd/wallet-sdk-gomobile/go.sum +++ b/cmd/wallet-sdk-gomobile/go.sum @@ -157,8 +157,8 @@ github.com/trustbloc/kms-go v1.1.2 h1:nAlhDoHkSyX1eQFRz/sJsdgmJuNadyX7FJEy/9ROwy github.com/trustbloc/kms-go v1.1.2/go.mod h1:OKOtsLbE6W5s4mpjWkvk8XEqcmt9vTgVmDNkHELpWO0= github.com/trustbloc/sidetree-go v1.1.0 h1:ZNCtYTut5MHVXJR26FvOPSo8uCGDR0YTNeA155s/QIo= github.com/trustbloc/sidetree-go v1.1.0/go.mod h1:IQ1iX/gLe/YL+M6kzenc5Oi14uzaYqfL7KgMyNuSGvI= -github.com/trustbloc/vc-go v1.1.2 h1:P2s0Hcm1Rghvi4H9Us0RNq64RzTSlM9ZVd0ZcHTEwD0= -github.com/trustbloc/vc-go v1.1.2/go.mod h1:3TifHPFmaBqSY0SCFOzfj964aA8Xm2VmwY3VnYP7SRg= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 h1:LHfRWVMMAgErdHRCwINZ0uBSUJimjH0HYZqNONPbFQs= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098/go.mod h1:FXDDzwuwOUJKTLjX9K+XbotQrW5b5cSgcwm+OAFsZ7c= github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4o= github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/go.mod b/go.mod index ef192bea..c39603db 100644 --- a/go.mod +++ b/go.mod @@ -16,13 +16,13 @@ require ( github.com/trustbloc/did-go v1.2.1 github.com/trustbloc/kms-go v1.1.2 github.com/trustbloc/sidetree-go v1.1.0 - github.com/trustbloc/vc-go v1.1.2 + github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 golang.org/x/oauth2 v0.13.0 ) require ( github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da // indirect - github.com/PaesslerAG/gval v1.1.0 // indirect + github.com/PaesslerAG/gval v1.2.2 // indirect github.com/VictoriaMetrics/fastcache v1.5.7 // indirect github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect @@ -55,6 +55,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8 // indirect github.com/tidwall/gjson v1.14.3 // indirect diff --git a/go.sum b/go.sum index fbf05d0d..8e032e98 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw= github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= github.com/PaesslerAG/gval v1.0.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= -github.com/PaesslerAG/gval v1.1.0 h1:k3RuxeZDO3eejD4cMPSt+74tUSvTnbGvLx0df4mdwFc= -github.com/PaesslerAG/gval v1.1.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= +github.com/PaesslerAG/gval v1.2.2 h1:Y7iBzhgE09IGTt5QgGQ2IdaYYYOU134YGHBThD+wm9E= +github.com/PaesslerAG/gval v1.2.2/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac= github.com/PaesslerAG/jsonpath v0.1.0/go.mod h1:4BzmtoM/PI8fPO4aQGIusjGxGir2BzcV0grWtFzq1Y8= github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk= github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= @@ -120,6 +120,8 @@ github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8 github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -152,8 +154,8 @@ github.com/trustbloc/kms-go v1.1.2 h1:nAlhDoHkSyX1eQFRz/sJsdgmJuNadyX7FJEy/9ROwy github.com/trustbloc/kms-go v1.1.2/go.mod h1:OKOtsLbE6W5s4mpjWkvk8XEqcmt9vTgVmDNkHELpWO0= github.com/trustbloc/sidetree-go v1.1.0 h1:ZNCtYTut5MHVXJR26FvOPSo8uCGDR0YTNeA155s/QIo= github.com/trustbloc/sidetree-go v1.1.0/go.mod h1:IQ1iX/gLe/YL+M6kzenc5Oi14uzaYqfL7KgMyNuSGvI= -github.com/trustbloc/vc-go v1.1.2 h1:P2s0Hcm1Rghvi4H9Us0RNq64RzTSlM9ZVd0ZcHTEwD0= -github.com/trustbloc/vc-go v1.1.2/go.mod h1:3TifHPFmaBqSY0SCFOzfj964aA8Xm2VmwY3VnYP7SRg= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 h1:LHfRWVMMAgErdHRCwINZ0uBSUJimjH0HYZqNONPbFQs= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098/go.mod h1:FXDDzwuwOUJKTLjX9K+XbotQrW5b5cSgcwm+OAFsZ7c= github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4o= github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/pkg/openid4vp/openid4vp.go b/pkg/openid4vp/openid4vp.go index 4430db0b..3e79b646 100644 --- a/pkg/openid4vp/openid4vp.go +++ b/pkg/openid4vp/openid4vp.go @@ -10,6 +10,7 @@ package openid4vp import ( "bytes" "crypto/rand" + "encoding/gob" "encoding/json" "errors" "fmt" @@ -83,9 +84,10 @@ type Interaction struct { } type authorizedResponse struct { - IDTokenJWS string - VPTokenJWS string - State string + IDTokenJWS string + VPTokenJWS string + PresentationSubmission string + State string } // NewInteraction creates a new OpenID4VP interaction object. @@ -113,7 +115,7 @@ func NewInteraction( rawRequestObject = authorizationRequest } - requestObject, err := verifyRequestObjectAndDecodeClaims(rawRequestObject, signatureVerifier) + reqObject, err := verifyRequestObjectAndDecodeClaims(rawRequestObject, signatureVerifier) if err != nil { return nil, walleterror.NewValidationError( ErrorModule, @@ -123,7 +125,7 @@ func NewInteraction( } return &Interaction{ - requestObject: requestObject, + requestObject: reqObject, httpClient: client, activityLogger: activityLogger, metricsLogger: metricsLogger, @@ -136,7 +138,7 @@ func NewInteraction( // GetQuery creates query based on authorization request data. func (o *Interaction) GetQuery() *presexch.PresentationDefinition { - return o.requestObject.Claims.VPToken.PresentationDefinition + return o.requestObject.PresentationDefinition } // CustomScope returns vp integration scope. @@ -156,9 +158,9 @@ func (o *Interaction) CustomScope() []string { func (o *Interaction) VerifierDisplayData() *VerifierDisplayData { return &VerifierDisplayData{ DID: o.requestObject.ClientID, - Name: o.requestObject.Registration.ClientName, - Purpose: o.requestObject.Registration.ClientPurpose, - LogoURI: o.requestObject.Registration.ClientLogoURI, + Name: o.requestObject.ClientMetadata.ClientName, + Purpose: o.requestObject.ClientMetadata.ClientPurpose, + LogoURI: o.requestObject.ClientMetadata.ClientLogoURI, } } @@ -264,6 +266,7 @@ func (o *Interaction) presentCredentials( data := url.Values{} data.Set("id_token", response.IDTokenJWS) data.Set("vp_token", response.VPTokenJWS) + data.Set("presentation_submission", response.PresentationSubmission) data.Set("state", response.State) err = o.sendAuthorizedResponse(data.Encode()) @@ -284,7 +287,7 @@ func (o *Interaction) presentCredentials( Type: api.LogTypeCredentialActivity, Time: time.Now(), Data: api.Data{ - Client: o.requestObject.Registration.ClientName, + Client: o.requestObject.ClientMetadata.ClientName, Operation: activityLogOperation, Status: api.ActivityLogStatusSuccess, }, @@ -292,7 +295,7 @@ func (o *Interaction) presentCredentials( } func (o *Interaction) PresentedClaims(credential *verifiable.Credential) (interface{}, error) { - pd := o.requestObject.Claims.VPToken.PresentationDefinition + pd := o.requestObject.PresentationDefinition bbsProofCreator := &verifiable.BBSProofCreator{ ProofDerivation: bbs12381g2pub.New(), @@ -324,9 +327,9 @@ func (o *Interaction) PresentedClaims(credential *verifiable.Credential) (interf func (o *Interaction) sendAuthorizedResponse(responseBody string) error { _, err := httprequest.New(o.httpClient, o.metricsLogger).Do(http.MethodPost, - o.requestObject.RedirectURI, "application/x-www-form-urlencoded", + o.requestObject.ResponseURI, "application/x-www-form-urlencoded", bytes.NewBufferString(responseBody), - fmt.Sprintf(sendAuthorizedResponseEventText, o.requestObject.RedirectURI), + fmt.Sprintf(sendAuthorizedResponseEventText, o.requestObject.ResponseURI), presentCredentialEventText, processAuthorizationErrorResponse) return err @@ -371,14 +374,29 @@ func verifyRequestObjectAndDecodeClaims( rawRequestObject string, signatureVerifier jwt.ProofChecker, ) (*requestObject, error) { - requestObject := &requestObject{} + reqObject := &requestObject{} - err := verifyTokenSignatureAndDecodeClaims(rawRequestObject, requestObject, signatureVerifier) + err := verifyTokenSignatureAndDecodeClaims(rawRequestObject, reqObject, signatureVerifier) if err != nil { return nil, err } - return requestObject, nil + // temporary solution for backward compatibility + if reqObject.PresentationDefinition == nil && reqObject.Claims.VPToken.PresentationDefinition != nil { + reqObject.PresentationDefinition = reqObject.Claims.VPToken.PresentationDefinition + } + if reqObject.ClientMetadata.VPFormats == nil && reqObject.Registration.VPFormats != nil { + reqObject.ClientMetadata.ClientName = reqObject.Registration.ClientName + reqObject.ClientMetadata.ClientPurpose = reqObject.Registration.ClientPurpose + reqObject.ClientMetadata.ClientLogoURI = reqObject.Registration.LogoURI + reqObject.ClientMetadata.VPFormats = reqObject.Registration.VPFormats + reqObject.ClientMetadata.SubjectSyntaxTypesSupported = reqObject.Registration.SubjectSyntaxTypesSupported + } + if reqObject.ResponseURI == "" && reqObject.RedirectURI != "" { + reqObject.ResponseURI = reqObject.RedirectURI + } + + return reqObject, nil } func verifyTokenSignatureAndDecodeClaims(rawJwt string, claims interface{}, proofChecker jwt.ProofChecker) error { @@ -428,7 +446,7 @@ func createAuthorizedResponseOneCred( //nolint:funlen,gocyclo // Unable to decom documentLoader ld.DocumentLoader, opts *presentOpts, ) (*authorizedResponse, error) { - pd := requestObject.Claims.VPToken.PresentationDefinition + pd := requestObject.PresentationDefinition if opts != nil && opts.ignoreConstraints { for i := range pd.InputDescriptors { @@ -450,7 +468,7 @@ func createAuthorizedResponseOneCred( //nolint:funlen,gocyclo // Unable to decom verifiable.WithJSONLDDocumentLoader(documentLoader), verifiable.WithProofChecker(defaults.NewDefaultProofChecker(common.NewVDRKeyResolver(didResolver))), ), - presexch.WithDefaultPresentationFormat("jwt_vp"), + presexch.WithDefaultPresentationFormat(presexch.FormatJWTVP), ) if err != nil { return nil, err @@ -488,10 +506,6 @@ func createAuthorizedResponseOneCred( //nolint:funlen,gocyclo // Unable to decom return nil, err } - presentationSubmission := presentation.CustomFields["presentation_submission"] - - presentation.CustomFields["presentation_submission"] = nil - var attestationVP string if opts != nil && opts.attestationVC != "" { attestationVP, err = createAttestationVP( @@ -501,7 +515,10 @@ func createAuthorizedResponseOneCred( //nolint:funlen,gocyclo // Unable to decom } } - idTokenJWS, err := createIDToken(requestObject, presentationSubmission, did, customClaims, jwtSigner, attestationVP) + presentationSubmission := presentation.CustomFields["presentation_submission"] + presentation.CustomFields["presentation_submission"] = nil + + idTokenJWS, err := createIDToken(requestObject, did, customClaims, jwtSigner, attestationVP, presentationSubmission) if err != nil { return nil, err } @@ -522,7 +539,17 @@ func createAuthorizedResponseOneCred( //nolint:funlen,gocyclo // Unable to decom return nil, fmt.Errorf("sign vp_token: %w", err) } - return &authorizedResponse{IDTokenJWS: idTokenJWS, VPTokenJWS: vpTokenJWS, State: requestObject.State}, nil + presentationSubmissionBytes, err := json.Marshal(presentationSubmission) + if err != nil { + return nil, fmt.Errorf("marshal presentation submission: %w", err) + } + + return &authorizedResponse{ + IDTokenJWS: idTokenJWS, + VPTokenJWS: vpTokenJWS, + PresentationSubmission: string(presentationSubmissionBytes), + State: requestObject.State, + }, nil } func createAuthorizedResponseMultiCred( //nolint:funlen,gocyclo // Unable to decompose without a major reworking @@ -535,14 +562,14 @@ func createAuthorizedResponseMultiCred( //nolint:funlen,gocyclo // Unable to dec signer wrapperapi.KMSCryptoSigner, opts *presentOpts, ) (*authorizedResponse, error) { - pd := requestObject.Claims.VPToken.PresentationDefinition + pd := requestObject.PresentationDefinition bbsProofCreator := &verifiable.BBSProofCreator{ ProofDerivation: bbs12381g2pub.New(), VerificationMethodResolver: common.NewVDRKeyResolver(didResolver), } - presentations, submission, err := pd.CreateVPArray( + presentations, presentationSubmission, err := pd.CreateVPArray( credentials, documentLoader, presexch.WithSDBBSProofCreator(bbsProofCreator), @@ -550,7 +577,7 @@ func createAuthorizedResponseMultiCred( //nolint:funlen,gocyclo // Unable to dec verifiable.WithDisabledProofCheck(), verifiable.WithJSONLDDocumentLoader(documentLoader), ), - presexch.WithDefaultPresentationFormat("jwt_vp"), + presexch.WithDefaultPresentationFormat(presexch.FormatJWTVP), ) if err != nil { return nil, err @@ -630,16 +657,22 @@ func createAuthorizedResponseMultiCred( //nolint:funlen,gocyclo // Unable to dec } } - idTokenJWS, err := createIDToken(requestObject, submission, idTokenSigningDID, - customClaims, signers[idTokenSigningDID], attestationVP) + idTokenJWS, err := createIDToken(requestObject, idTokenSigningDID, customClaims, + signers[idTokenSigningDID], attestationVP, presentationSubmission) if err != nil { return nil, err } + presentationSubmissionJSON, err := json.Marshal(presentationSubmission) + if err != nil { + return nil, fmt.Errorf("marshal presentation submission: %w", err) + } + return &authorizedResponse{ - IDTokenJWS: idTokenJWS, - VPTokenJWS: string(vpTokenListJSON), - State: requestObject.State, + IDTokenJWS: idTokenJWS, + VPTokenJWS: string(vpTokenListJSON), + PresentationSubmission: string(presentationSubmissionJSON), + State: requestObject.State, }, nil } @@ -672,16 +705,13 @@ func addDataIntegrityProof(did string, didResolver api.DIDResolver, documentLoad func createIDToken( req *requestObject, - submission interface{}, signingDID string, customClaims CustomClaims, signer api.JWTSigner, attestationVP string, + presentationSubmission interface{}, ) (string, error) { idToken := &idTokenClaims{ - VPToken: idTokenVPToken{ - PresentationSubmission: submission, - }, Scope: customClaims.ScopeClaims, AttestationVP: attestationVP, Nonce: req.Nonce, @@ -694,6 +724,28 @@ func createIDToken( Jti: uuid.NewString(), } + if ps, ok := presentationSubmission.(*presexch.PresentationSubmission); ok { + var psCopy presexch.PresentationSubmission + + if err := deepCopy(ps, &psCopy); err != nil { + return "", fmt.Errorf("deep copy presentation submission: %w", err) + } + + for _, descriptor := range psCopy.DescriptorMap { + if descriptor.PathNested != nil { + descriptor.PathNested.Path = strings.Replace(descriptor.PathNested.Path, "$.vp.", "$.", 1) + } + } + + idToken.VPToken = idTokenVPToken{ + PresentationSubmission: psCopy, + } + } else { + idToken.VPToken = idTokenVPToken{ + PresentationSubmission: presentationSubmission, + } + } + idTokenJWS, err := signToken(idToken, signer) if err != nil { return "", fmt.Errorf("sign id_token: %w", err) @@ -702,6 +754,16 @@ func createIDToken( return idTokenJWS, nil } +func deepCopy(src, dst interface{}) error { + var b bytes.Buffer + + if err := gob.NewEncoder(&b).Encode(src); err != nil { + return err + } + + return gob.NewDecoder(bytes.NewBuffer(b.Bytes())).Decode(dst) +} + func createAttestationVP( attestationVCData string, attestationVPSigner api.JWTSigner, diff --git a/pkg/openid4vp/openid4vp_test.go b/pkg/openid4vp/openid4vp_test.go index e2d7d03a..d85f1b2f 100644 --- a/pkg/openid4vp/openid4vp_test.go +++ b/pkg/openid4vp/openid4vp_test.go @@ -46,9 +46,6 @@ var ( //go:embed test_data/credentials.jsonld credentialsJSONLD []byte - //go:embed test_data/verifier_did.data - verifierDID string - //go:embed test_data/attestation_cred.jwt attestationCredJWT string ) @@ -57,6 +54,7 @@ const ( testSignature = "test signature" mockDID = "did:example:12345" mockVMID = "#key-1" + verifierDID = "did:test:acde" ) type failingMetricsLogger struct { @@ -232,13 +230,9 @@ func TestOpenID4VP_PresentCredential(t *testing.T) { } mockRequestObject := &requestObject{ - Nonce: "test123456", - State: "test34566", - Claims: requestObjectClaims{ - VPToken: vpToken{ - PresentationDefinition: mockPresentationDefinition, - }, - }, + Nonce: "test123456", + State: "test34566", + PresentationDefinition: mockPresentationDefinition, } t.Run("Success", func(t *testing.T) { @@ -263,8 +257,8 @@ func TestOpenID4VP_PresentCredential(t *testing.T) { require.NoError(t, err) require.Equal(t, verifierDID, displayData.DID) require.Equal(t, "v_myprofile_jwt", displayData.Name) - require.Equal(t, "", displayData.Purpose) - require.Equal(t, "", displayData.LogoURI) + require.Equal(t, "test verifier", displayData.Purpose) + require.Equal(t, "https://example.com/verifier/logo", displayData.LogoURI) err = interaction.PresentCredential(credentials, CustomClaims{}) @@ -280,31 +274,18 @@ func TestOpenID4VP_PresentCredential(t *testing.T) { data, err := url.ParseQuery(string(httpClient.SentBody)) require.NoError(t, err) - var submissionWrapper struct { - VPToken struct { - PresentationSubmission *presexch.PresentationSubmission `json:"presentation_submission"` - } `json:"_vp_token"` - } - - payloadBytes := func(jws string) []byte { - parts := strings.Split(jws, ".") - if len(parts) != 3 { - return nil - } - - payload, e := base64.RawURLEncoding.DecodeString(parts[1]) - require.NoError(t, e) - - return payload - } - require.Contains(t, data, "id_token") require.NotEmpty(t, data["id_token"]) - require.NoError(t, json.Unmarshal(payloadBytes(data["id_token"][0]), &submissionWrapper)) - require.Contains(t, data, "vp_token") require.NotEmpty(t, data["vp_token"]) + + require.Contains(t, data, "presentation_submission") + require.NotEmpty(t, data["presentation_submission"]) + + var presentationSubmission *presexch.PresentationSubmission + require.NoError(t, json.Unmarshal([]byte(data["presentation_submission"][0]), &presentationSubmission)) + var vpTokenList []string require.NoError(t, json.Unmarshal([]byte(data["vp_token"][0]), &vpTokenList)) @@ -317,16 +298,14 @@ func TestOpenID4VP_PresentCredential(t *testing.T) { verifiable.WithDisabledJSONLDChecks()) require.NoError(t, e) - parsedPresentation.JWT = "" - presentations = append(presentations, parsedPresentation) } - _, err = interaction.requestObject.Claims.VPToken.PresentationDefinition.Match( + _, err = interaction.requestObject.PresentationDefinition.Match( presentations, lddl, presexch.WithDisableSchemaValidation(), - presexch.WithMergedSubmission(submissionWrapper.VPToken.PresentationSubmission), + presexch.WithMergedSubmission(presentationSubmission), presexch.WithCredentialOptions(verifiable.WithDisabledProofCheck(), verifiable.WithJSONLDDocumentLoader(lddl)), ) require.NoError(t, err) @@ -483,13 +462,9 @@ func TestOpenID4VP_PresentCredential(t *testing.T) { } req := &requestObject{ - Nonce: "test123456", - State: "test34566", - Claims: requestObjectClaims{ - VPToken: vpToken{ - PresentationDefinition: pd, - }, - }, + Nonce: "test123456", + State: "test34566", + PresentationDefinition: pd, } // ...so creating a VP fails... @@ -974,8 +949,8 @@ func TestOpenID4VP_PresentedClaims(t *testing.T) { require.NoError(t, err) require.Equal(t, verifierDID, displayData.DID) require.Equal(t, "v_myprofile_jwt", displayData.Name) - require.Equal(t, "", displayData.Purpose) - require.Equal(t, "", displayData.LogoURI) + require.Equal(t, "test verifier", displayData.Purpose) + require.Equal(t, "https://example.com/verifier/logo", displayData.LogoURI) claims, err := interaction.PresentedClaims(credentials[0]) require.NoError(t, err) diff --git a/pkg/openid4vp/request_object.go b/pkg/openid4vp/request_object.go index 93f61a5b..af92a8ef 100644 --- a/pkg/openid4vp/request_object.go +++ b/pkg/openid4vp/request_object.go @@ -9,32 +9,49 @@ package openid4vp import "github.com/trustbloc/vc-go/presexch" type requestObject struct { - JTI string `json:"jti"` - IAT int64 `json:"iat"` - Issuer string `json:"iss"` - ResponseType string `json:"response_type"` //nolint: tagliatelle - ResponseMode string `json:"response_mode"` //nolint: tagliatelle - Scope string `json:"scope"` - Nonce string `json:"nonce"` - ClientID string `json:"client_id"` //nolint: tagliatelle - RedirectURI string `json:"redirect_uri"` //nolint: tagliatelle - State string `json:"state"` - Exp int64 `json:"exp"` + JTI string `json:"jti"` + IAT int64 `json:"iat"` + Issuer string `json:"iss"` + ResponseType string `json:"response_type"` //nolint: tagliatelle + ResponseMode string `json:"response_mode"` //nolint: tagliatelle + ResponseURI string `json:"response_uri"` + Scope string `json:"scope"` + Nonce string `json:"nonce"` + ClientID string `json:"client_id"` //nolint: tagliatelle + ClientIDScheme string `json:"client_id_scheme"` + State string `json:"state"` + Exp int64 `json:"exp"` + ClientMetadata clientMetadata `json:"client_metadata"` + PresentationDefinition *presexch.PresentationDefinition `json:"presentation_definition"` + + // Deprecated: Use response_uri instead. + RedirectURI string `json:"redirect_uri"` + // Deprecated: Use client_metadata instead. Registration requestObjectRegistration `json:"registration"` - Claims requestObjectClaims `json:"claims"` + // Deprecated: Use top-level "presentation_definition" instead. + Claims requestObjectClaims `json:"claims"` } -type requestObjectRegistration struct { +type clientMetadata struct { ClientName string `json:"client_name"` //nolint: tagliatelle - SubjectSyntaxTypesSupported []string `json:"subject_syntax_types_supported"` //nolint: tagliatelle - VPFormats *presexch.Format `json:"vp_formats"` //nolint: tagliatelle ClientPurpose string `json:"client_purpose"` //nolint: tagliatelle ClientLogoURI string `json:"logo_uri"` //nolint: tagliatelle + SubjectSyntaxTypesSupported []string `json:"subject_syntax_types_supported"` //nolint: tagliatelle + VPFormats *presexch.Format `json:"vp_formats"` //nolint: tagliatelle +} + +type requestObjectRegistration struct { + ClientName string `json:"client_name"` + SubjectSyntaxTypesSupported []string `json:"subject_syntax_types_supported"` + VPFormats *presexch.Format `json:"vp_formats"` + ClientPurpose string `json:"client_purpose"` + LogoURI string `json:"logo_uri"` } type requestObjectClaims struct { - VPToken vpToken `json:"vp_token"` //nolint: tagliatelle + VPToken vpToken `json:"vp_token"` } + type vpToken struct { - PresentationDefinition *presexch.PresentationDefinition `json:"presentation_definition"` //nolint: tagliatelle + PresentationDefinition *presexch.PresentationDefinition `json:"presentation_definition"` } diff --git a/pkg/openid4vp/test_data/request_object.jwt b/pkg/openid4vp/test_data/request_object.jwt index 73b44eea..5840dd5e 100644 --- a/pkg/openid4vp/test_data/request_object.jwt +++ b/pkg/openid4vp/test_data/request_object.jwt @@ -1 +1 @@ -eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6aW9uOkVpRFlXY0R1UC1FRGpWeUZXR0ZkcGdQbmNhcjlBN09HRnlrZGVYNzFaVFUtd2c6ZXlKa1pXeDBZU0k2ZXlKd1lYUmphR1Z6SWpwYmV5SmhZM1JwYjI0aU9pSnlaWEJzWVdObElpd2laRzlqZFcxbGJuUWlPbnNpY0hWaWJHbGpTMlY1Y3lJNlczc2lhV1FpT2lKemFXZHVhVz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zIwMTgvY3JlZGVudGlhbHMjVmVyaWZpYWJsZUNyZWRlbnRpYWwifV19XX0sInJlc3BvbnNlX21vZGUiOiJkaXJlY3RfcG9zdCIsInJlc3BvbnNlX3R5cGUiOiJ2cF90b2tlbiBpZF90b2tlbiIsInJlc3BvbnNlX3VyaSI6InRlc3Q6Ly9yZXNwb25zZSIsInNjb3BlIjoib3BlbmlkIiwic3RhdGUiOiI2MzZkZjI4NDU5YTA3ZDUwY2M0YjY1N2UifQ.tUxRKou8qq2kxv9BPQFl6-rO1zWeby_LRWli9POiwDUnBORmoHThvV_oZeVzEzKRYwsTxghmrlm_VyORYZPHCg \ No newline at end of file diff --git a/pkg/openid4vp/test_data/verifier_did.data b/pkg/openid4vp/test_data/verifier_did.data deleted file mode 100644 index 90b4ccdc..00000000 --- a/pkg/openid4vp/test_data/verifier_did.data +++ /dev/null @@ -1 +0,0 @@ -did:ion:EiDYWcDuP-EDjVyFWGFdpgPncar9A7OGFykdeX71ZTU-wg:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWduaW5nS2V5IiwicHVibGljS2V5SndrIjp7ImNydiI6InNlY3AyNTZrMSIsImt0eSI6IkVDIiwieCI6InlMSUJTeFUxS3RLSVJab2lFbHloWFV1c3U4WGVjZDZfNHZGOVpET05nRmsiLCJ5IjoiTHhMT2UzRE15S0dQQWRBWVp6bHA4SkZ1Y0RfRHFlb3J0a1ZaRGxsVjFqNCJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiIsImFzc2VydGlvbk1ldGhvZCIsImNhcGFiaWxpdHlJbnZvY2F0aW9uIiwiY2FwYWJpbGl0eURlbGVnYXRpb24iLCJrZXlBZ3JlZW1lbnQiXSwidHlwZSI6IkVjZHNhU2VjcDI1NmsxVmVyaWZpY2F0aW9uS2V5MjAxOSJ9LHsiaWQiOiI3MjA3YTJmYy1iYzZmLTQyOGItOTEwYy0zZjE3NWNmNjI0OTQiLCJwdWJsaWNLZXlKd2siOnsiY3J2Ijoic2VjcDI1NmsxIiwia3R5IjoiRUMiLCJ4IjoicS1ycG0yLWpEek9ZLS1FYUswWkNubWphUDVOX0NXRHk5VUc2LVFpM3VRZyIsInkiOiJVN1hpMHl0Q00zcnB3RWVOendIcmNobXY2WXFhZnRfSU03TTg4SEZlLWk4In0sInB1cnBvc2VzIjpbImF1dGhlbnRpY2F0aW9uIiwiYXNzZXJ0aW9uTWV0aG9kIl0sInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkifV0sInNlcnZpY2VzIjpbeyJpZCI6IkxpbmtlZERvbWFpbnMiLCJzZXJ2aWNlRW5kcG9pbnQiOnsib3JpZ2lucyI6WyJodHRwOi8vdmNzLndlYmhvb2suZXhhbXBsZS5jb206ODE4MC8iXX0sInR5cGUiOiJMaW5rZWREb21haW5zIn1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlDU0V2WTFsMFBPdDltQi13N0pyZkZZWkRrTFZmZ3BHZDFXYy0zd3F2b3QwQSJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQml3NmdUbnpoQUJtc3Y4LUp6RXZlWjR5MUstY0hyXzdPT01hMWNJeGpST3ciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUJWaC1BOUtmak1QZGo2YWxCSUZ5c0YxM292YTl1NEI1TDlubEJBODNXSVFRIn0sInR5cGUiOiJjcmVhdGUifQ \ No newline at end of file diff --git a/pkg/openid4vp/tokens.go b/pkg/openid4vp/tokens.go index 9dffeada..fb912e07 100644 --- a/pkg/openid4vp/tokens.go +++ b/pkg/openid4vp/tokens.go @@ -10,17 +10,12 @@ import ( "github.com/trustbloc/vc-go/verifiable" ) -type idTokenVPToken struct { - PresentationSubmission interface{} `json:"presentation_submission"` //nolint: tagliatelle -} - // CustomClaims represents custom claims to be added to id_token. type CustomClaims struct { ScopeClaims map[string]interface{} } type idTokenClaims struct { - VPToken idTokenVPToken `json:"_vp_token"` //nolint: tagliatelle Scope map[string]interface{} `json:"_scope,omitempty"` //nolint: tagliatelle AttestationVP string `json:"_attestation_vp"` Nonce string `json:"nonce"` @@ -31,6 +26,13 @@ type idTokenClaims struct { Nbf int64 `json:"nbf"` Iat int64 `json:"iat"` Jti string `json:"jti"` + + // Deprecated: Use top-level "presentation_submission" instead. + VPToken idTokenVPToken `json:"_vp_token"` +} + +type idTokenVPToken struct { + PresentationSubmission interface{} `json:"presentation_submission"` //nolint: tagliatelle } type vpTokenClaims struct { diff --git a/test/integration/attestation/go.mod b/test/integration/attestation/go.mod index d161e6a1..78b911fe 100644 --- a/test/integration/attestation/go.mod +++ b/test/integration/attestation/go.mod @@ -12,7 +12,7 @@ require ( github.com/trustbloc/cmdutil-go v1.0.0 github.com/trustbloc/did-go v1.2.1 github.com/trustbloc/kms-go v1.1.2 - github.com/trustbloc/vc-go v1.1.2 + github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 github.com/trustbloc/wallet-sdk v0.0.0-00010101000000-000000000000 ) diff --git a/test/integration/attestation/go.sum b/test/integration/attestation/go.sum index 96f63cbc..cf59e675 100644 --- a/test/integration/attestation/go.sum +++ b/test/integration/attestation/go.sum @@ -1,7 +1,7 @@ github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw= github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= -github.com/PaesslerAG/gval v1.1.0 h1:k3RuxeZDO3eejD4cMPSt+74tUSvTnbGvLx0df4mdwFc= -github.com/PaesslerAG/gval v1.1.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= +github.com/PaesslerAG/gval v1.2.2 h1:Y7iBzhgE09IGTt5QgGQ2IdaYYYOU134YGHBThD+wm9E= +github.com/PaesslerAG/gval v1.2.2/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac= github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk= github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= @@ -119,6 +119,8 @@ github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8 github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -155,8 +157,8 @@ github.com/trustbloc/logutil-go v0.0.0-20221124174025-c46110e3ea42 h1:Mzg9wvEoUI github.com/trustbloc/logutil-go v0.0.0-20221124174025-c46110e3ea42/go.mod h1:HRaXVV1caceumbDBwLO3ByiCcAc18KwrNvZ7JQBvDIQ= github.com/trustbloc/sidetree-go v1.1.0 h1:ZNCtYTut5MHVXJR26FvOPSo8uCGDR0YTNeA155s/QIo= github.com/trustbloc/sidetree-go v1.1.0/go.mod h1:IQ1iX/gLe/YL+M6kzenc5Oi14uzaYqfL7KgMyNuSGvI= -github.com/trustbloc/vc-go v1.1.2 h1:P2s0Hcm1Rghvi4H9Us0RNq64RzTSlM9ZVd0ZcHTEwD0= -github.com/trustbloc/vc-go v1.1.2/go.mod h1:3TifHPFmaBqSY0SCFOzfj964aA8Xm2VmwY3VnYP7SRg= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 h1:LHfRWVMMAgErdHRCwINZ0uBSUJimjH0HYZqNONPbFQs= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098/go.mod h1:FXDDzwuwOUJKTLjX9K+XbotQrW5b5cSgcwm+OAFsZ7c= github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4o= github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/test/integration/cli/go.sum b/test/integration/cli/go.sum index 434558a5..964f2c0c 100644 --- a/test/integration/cli/go.sum +++ b/test/integration/cli/go.sum @@ -45,14 +45,13 @@ go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/test/integration/fixtures/.env b/test/integration/fixtures/.env index ce8cb67c..8e12f4f9 100644 --- a/test/integration/fixtures/.env +++ b/test/integration/fixtures/.env @@ -6,7 +6,7 @@ # vc services VC_REST_IMAGE=ghcr.io/trustbloc-cicd/vc-server -VC_REST_IMAGE_TAG=v1.8.2-snapshot-01d78d8 +VC_REST_IMAGE_TAG=v1.8.2-snapshot-49a9df8 # Remote JSON-LD context provider CONTEXT_PROVIDER_URL=https://file-server.trustbloc.local:10096/ld-contexts.json @@ -24,4 +24,4 @@ MONGODB_PORT=27017 # API gateway and OAuth provider KRAKEND_IMAGE_TAG=2.1.3 -COGNITO_MOCK_IMAGE_TAG=0.2.2 \ No newline at end of file +COGNITO_MOCK_IMAGE_TAG=0.2.2 diff --git a/test/integration/go.mod b/test/integration/go.mod index b4095064..24a9c1bc 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -14,7 +14,7 @@ require ( github.com/trustbloc/cmdutil-go v0.0.0-20221125151303-09d42adcc811 github.com/trustbloc/did-go v1.2.1 github.com/trustbloc/logutil-go v1.0.0-rc1 - github.com/trustbloc/vc-go v1.1.2 + github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 github.com/trustbloc/wallet-sdk v0.0.0-00010101000000-000000000000 github.com/trustbloc/wallet-sdk/cmd/wallet-sdk-gomobile v0.0.0-00010101000000-000000000000 go.uber.org/zap v1.23.0 diff --git a/test/integration/go.sum b/test/integration/go.sum index 98830540..1c4a6e0a 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -167,8 +167,8 @@ github.com/trustbloc/logutil-go v1.0.0-rc1 h1:rRJbvgQfrlUfyej+mY0nuQJymGqjRW4oZE github.com/trustbloc/logutil-go v1.0.0-rc1/go.mod h1:JlxT0oZfNKgIlSNtgc001WEeDMxlnAvOM43gNm8DQVc= github.com/trustbloc/sidetree-go v1.1.0 h1:ZNCtYTut5MHVXJR26FvOPSo8uCGDR0YTNeA155s/QIo= github.com/trustbloc/sidetree-go v1.1.0/go.mod h1:IQ1iX/gLe/YL+M6kzenc5Oi14uzaYqfL7KgMyNuSGvI= -github.com/trustbloc/vc-go v1.1.2 h1:P2s0Hcm1Rghvi4H9Us0RNq64RzTSlM9ZVd0ZcHTEwD0= -github.com/trustbloc/vc-go v1.1.2/go.mod h1:3TifHPFmaBqSY0SCFOzfj964aA8Xm2VmwY3VnYP7SRg= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 h1:LHfRWVMMAgErdHRCwINZ0uBSUJimjH0HYZqNONPbFQs= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098/go.mod h1:FXDDzwuwOUJKTLjX9K+XbotQrW5b5cSgcwm+OAFsZ7c= github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4o= github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/test/integration/pkg/helpers/openid4ci.go b/test/integration/pkg/helpers/openid4ci.go index 7ef24854..44080cfd 100644 --- a/test/integration/pkg/helpers/openid4ci.go +++ b/test/integration/pkg/helpers/openid4ci.go @@ -221,24 +221,24 @@ func checkCredentialDisplay(t *testing.T, actualCredentialDisplay, } } -func claimOrderMatches(t *testing.T, claim1, claim2 *display.Claim) bool { +func claimOrderMatches(t *testing.T, actualClaim, expectedClaim *display.Claim) bool { t.Helper() - if claim1.HasOrder() { - if !claim2.HasOrder() { + if actualClaim.HasOrder() { + if !expectedClaim.HasOrder() { return false } - claim1Order, err := claim1.Order() + actualClaimOrder, err := actualClaim.Order() require.NoError(t, err) - claim2Order, err := claim1.Order() + expectedClaimOrder, err := expectedClaim.Order() require.NoError(t, err) - if claim1Order != claim2Order { + if actualClaimOrder != expectedClaimOrder { return false } - } else if claim2.HasOrder() { + } else if expectedClaim.HasOrder() { return false } diff --git a/test/integration/trustregistry/go.mod b/test/integration/trustregistry/go.mod index 10e16236..51e709c3 100644 --- a/test/integration/trustregistry/go.mod +++ b/test/integration/trustregistry/go.mod @@ -48,7 +48,7 @@ require ( github.com/trustbloc/bbs-signature-go v1.0.2 // indirect github.com/trustbloc/did-go v1.2.1 // indirect github.com/trustbloc/kms-go v1.1.2 // indirect - github.com/trustbloc/vc-go v1.1.2 // indirect + github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 // indirect github.com/veraison/go-cose v1.1.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect diff --git a/test/integration/trustregistry/go.sum b/test/integration/trustregistry/go.sum index 64506acf..74ad5cca 100644 --- a/test/integration/trustregistry/go.sum +++ b/test/integration/trustregistry/go.sum @@ -1,7 +1,7 @@ github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw= github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= -github.com/PaesslerAG/gval v1.1.0 h1:k3RuxeZDO3eejD4cMPSt+74tUSvTnbGvLx0df4mdwFc= -github.com/PaesslerAG/gval v1.1.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= +github.com/PaesslerAG/gval v1.2.2 h1:Y7iBzhgE09IGTt5QgGQ2IdaYYYOU134YGHBThD+wm9E= +github.com/PaesslerAG/gval v1.2.2/go.mod h1:XRFLwvmkTEdYziLdaCeCa5ImcGVrfQbeNUbVR+C6xac= github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk= github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= @@ -96,6 +96,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -120,8 +122,8 @@ github.com/trustbloc/did-go v1.2.1 h1:SEOmPX+x2JlE6+jjjJp82yCCusoJ4/67zQ2ST6ytfS github.com/trustbloc/did-go v1.2.1/go.mod h1:packTRoBoo8DrwOE7QKsI98xXS3Vf6ovUXYD4FUAcB4= github.com/trustbloc/kms-go v1.1.2 h1:nAlhDoHkSyX1eQFRz/sJsdgmJuNadyX7FJEy/9ROwys= github.com/trustbloc/kms-go v1.1.2/go.mod h1:OKOtsLbE6W5s4mpjWkvk8XEqcmt9vTgVmDNkHELpWO0= -github.com/trustbloc/vc-go v1.1.2 h1:P2s0Hcm1Rghvi4H9Us0RNq64RzTSlM9ZVd0ZcHTEwD0= -github.com/trustbloc/vc-go v1.1.2/go.mod h1:3TifHPFmaBqSY0SCFOzfj964aA8Xm2VmwY3VnYP7SRg= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098 h1:LHfRWVMMAgErdHRCwINZ0uBSUJimjH0HYZqNONPbFQs= +github.com/trustbloc/vc-go v1.1.3-0.20240627155354-563ff5d6e098/go.mod h1:FXDDzwuwOUJKTLjX9K+XbotQrW5b5cSgcwm+OAFsZ7c= github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4o= github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=