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

Commit

Permalink
refactor: web-redirector with underscore
Browse files Browse the repository at this point in the history
Following this DIDcomm V2 spec udpate:
decentralized-identity/didcomm-messaging#363
web-redirect is now web_redirect.

Signed-off-by: Baha Shaaban <baha.shaaban@securekey.com>
  • Loading branch information
Baha Shaaban committed Apr 22, 2022
1 parent ab194a3 commit af37965
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/didcomm/common/model/ack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/didcomm/protocol/issuecredential/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/didcomm/protocol/issuecredential/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/didcomm/protocol/presentproof/states.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
codeInternalError = "internal"
codeRejectedError = "rejected"
webRedirect = "~web-redirect"
webRedirectV2 = "web-redirect"
webRedirectV2 = "web_redirect"
)

// state action for network call.
Expand Down

0 comments on commit af37965

Please sign in to comment.