From af379654236871a978ca7a9b9a1fcdd4f11f8727 Mon Sep 17 00:00:00 2001 From: Baha Shaaban Date: Fri, 22 Apr 2022 09:34:19 -0400 Subject: [PATCH] refactor: web-redirector with underscore Following this DIDcomm V2 spec udpate: decentralized-identity/didcomm-messaging#363 web-redirect is now web_redirect. Signed-off-by: Baha Shaaban --- pkg/didcomm/common/model/ack.go | 2 +- pkg/didcomm/protocol/issuecredential/models.go | 2 +- pkg/didcomm/protocol/issuecredential/service.go | 2 +- pkg/didcomm/protocol/presentproof/states.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/didcomm/common/model/ack.go b/pkg/didcomm/common/model/ack.go index f549d30828..5fa790c3f4 100644 --- a/pkg/didcomm/common/model/ack.go +++ b/pkg/didcomm/common/model/ack.go @@ -29,7 +29,7 @@ type Ack struct { type AckV2 struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` - WebRedirect interface{} `json:"web-redirect,omitempty"` + WebRedirect interface{} `json:"web_redirect,omitempty"` Body AckV2Body `json:"body,omitempty"` } diff --git a/pkg/didcomm/protocol/issuecredential/models.go b/pkg/didcomm/protocol/issuecredential/models.go index a9aa514b7a..fa0b4cc302 100644 --- a/pkg/didcomm/protocol/issuecredential/models.go +++ b/pkg/didcomm/protocol/issuecredential/models.go @@ -164,7 +164,7 @@ type IssueCredentialV3 struct { //nolint: golint ID string `json:"id,omitempty"` Body IssueCredentialV3Body `json:"body,omitempty"` // WebRedirect contains optional web redirect info to be sent to holder for redirect. - WebRedirect *decorator.WebRedirect `json:"web-redirect,omitempty"` + WebRedirect *decorator.WebRedirect `json:"web_redirect,omitempty"` // Attachments is an array of attachments containing the presentation in the requested format(s). // Accepted values for the format attribute of each attachment are provided in the per format Attachment // registry immediately below. diff --git a/pkg/didcomm/protocol/issuecredential/service.go b/pkg/didcomm/protocol/issuecredential/service.go index 7d89f5a622..37bf09b1be 100644 --- a/pkg/didcomm/protocol/issuecredential/service.go +++ b/pkg/didcomm/protocol/issuecredential/service.go @@ -909,7 +909,7 @@ func (s *Service) Accept(msgType string) bool { func redirectInfo(msg service.DIDCommMsg) map[string]interface{} { var redirectInfo struct { WebRedirectV2 map[string]interface{} `json:"~web-redirect,omitempty"` - WebRedirectV3 map[string]interface{} `json:"web-redirect,omitempty"` + WebRedirectV3 map[string]interface{} `json:"web_redirect,omitempty"` } err := msg.Decode(&redirectInfo) diff --git a/pkg/didcomm/protocol/presentproof/states.go b/pkg/didcomm/protocol/presentproof/states.go index 8c4b39b29e..2d895710eb 100644 --- a/pkg/didcomm/protocol/presentproof/states.go +++ b/pkg/didcomm/protocol/presentproof/states.go @@ -40,7 +40,7 @@ const ( codeInternalError = "internal" codeRejectedError = "rejected" webRedirect = "~web-redirect" - webRedirectV2 = "web-redirect" + webRedirectV2 = "web_redirect" ) // state action for network call.