Skip to content

Commit

Permalink
fix: clone pd
Browse files Browse the repository at this point in the history
  • Loading branch information
skynet2 committed Sep 25, 2024
1 parent b6ca73e commit b91b189
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions component/wallet-cli/pkg/oidc4vp/oidc4vp_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"time"

"github.com/google/uuid"
"github.com/jinzhu/copier"
"github.com/piprate/json-gold/ld"
"github.com/trustbloc/did-go/doc/did"
vdrapi "github.com/trustbloc/did-go/vdr/api"
Expand Down Expand Up @@ -180,12 +179,13 @@ func (f *Flow) Run(ctx context.Context) error {

var pd presexch.PresentationDefinition

if err = copier.CopyWithOption(
&pd,
requestObject.PresentationDefinition,
copier.Option{IgnoreEmpty: true, DeepCopy: true},
); err != nil {
return fmt.Errorf("copy presentation definition: %w", err)
rawPD, err := json.Marshal(requestObject.PresentationDefinition)
if err != nil {
return fmt.Errorf("marshal presentation definition: %w", err)
}

if err = json.Unmarshal(rawPD, &pd); err != nil {
return fmt.Errorf("unmarshal presentation definition: %w", err)
}

if f.disableSchemaValidation && len(pd.InputDescriptors) > 0 {
Expand Down

0 comments on commit b91b189

Please sign in to comment.