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

Commit

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

Signed-off-by: Baha Shaaban <baha.shaaban@securekey.com>
  • Loading branch information
Baha Shaaban committed Apr 21, 2022
1 parent 7d95f17 commit 24b9947
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- WACI Presentation
- Credential Manifest support & minor improvements
- Aries RFCs / Interop
- Web-redirect support in issue-credential and present-proof protocols (V2 and V3)
- web-redirect support in issue-credential and present-proof protocols (V2 and V3)
- Media type profile support
- Various minor fixes
- Fixes and improvements to Crypto, KMS, VDR, Verifiable Credential, Storage, and other components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestOutOfBand_CreateInvitation(t *testing.T) {

mockResponse := `{"invitation":{"@id":"2429a5d3-c500-4647-9bb5-e34207bce406",
"@type":"https://didcomm.org/out-of-band/1.0/invitation","label":"label","goal":"goal",
"goal-code":"goal_code","service":["s1"],"protocols":["s1"]}}
"goal_code":"goal_code","service":["s1"],"protocols":["s1"]}}
`
fakeHandler := mockCommandRunner{data: []byte(mockResponse)}
controller.handlers[outofband.CreateInvitation] = fakeHandler.exec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestOutOfBandV2_CreateInvitation(t *testing.T) {

mockResponse := `{"invitation":{"@id":"2429a5d3-c500-4647-9bb5-e34207bce406",
"@type":"https://didcomm.org/out-of-band/2.0/invitation","label":"label","body":{
"goal":"goal","goal-code":"goal_code","accept":["didcomm/v2"]}}}
"goal":"goal","goal_code":"goal_code","accept":["didcomm/v2"]}}}
`
fakeHandler := mockCommandRunner{data: []byte(mockResponse)}
controller.handlers[outofbandv2.CreateInvitation] = fakeHandler.exec
Expand Down
4 changes: 2 additions & 2 deletions cmd/aries-agent-mobile/pkg/wrappers/rest/outofband_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestOutOfBand_CreateInvitation(t *testing.T) {
reqData := `{"label":"label","goal":"goal","goal_code":"goal_code","service":["s1"],"protocols":["s1"]}`
mockResponse := `{"invitation":{"@id":"2429a5d3-c500-4647-9bb5-e34207bce406",
"@type":"https://didcomm.org/out-of-band/1.0/invitation","label":"label","goal":"goal",
"goal-code":"goal_code","service":["s1"],"protocols":["s1"]}}
"goal_code":"goal_code","service":["s1"],"protocols":["s1"]}}
`

controller.httpClient = &mockHTTPClient{
Expand All @@ -160,7 +160,7 @@ func TestOutOfBand_CreateRequest(t *testing.T) {
reqData := `{"label":"label","goal":"goal","goal_code":"goal_code","service":["s1"],
"attachments":[{"lastmod_time":"0001-01-01T00:00:00Z","data":{}}]}`
mockResponse := `{"invitation":{"@id":"26169718-f261-48f1-addd-67018977a89f",
"@type":"https://didcomm.org/out-of-band/1.0/invitation","label":"label","goal":"goal","goal-code":"goal_code",
"@type":"https://didcomm.org/out-of-band/1.0/invitation","label":"label","goal":"goal","goal_code":"goal_code",
"request~attach":[{"lastmod_time":"0001-01-01T00:00:00Z","data":{}}],"service":["s1"]}}`

controller.httpClient = &mockHTTPClient{
Expand Down
2 changes: 1 addition & 1 deletion pkg/didcomm/protocol/introduce/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Proposal struct {
Thread *decorator.Thread `json:"~thread,omitempty"`
Timing *decorator.Timing `json:"~timing,omitempty"`
Goal string `json:"goal,omitempty"`
GoalCode string `json:"goal-code,omitempty"`
GoalCode string `json:"goal_code,omitempty"`
}

// To introducee descriptor keeps information about the introduction
Expand Down
4 changes: 2 additions & 2 deletions pkg/didcomm/protocol/issuecredential/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const (
commentText = "this is a comment"
goalCodeText = "goal-code"
goalCodeText = "goal_code"
messageIDText = "message-id-123"
)

Expand Down Expand Up @@ -47,7 +47,7 @@ func previewCredV3(t *testing.T) map[string]interface{} {
Type: CredentialPreviewMsgTypeV3,
ID: "bar-baz-qux",
Body: IssueCredentialV3Body{
GoalCode: "goal-code",
GoalCode: "goal_code",
ReplacementID: "blah-id",
Comment: commentText,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/didcomm/protocol/outofbandv2/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ type Invitation struct {
// InvitationBody contains invitation's goal and accept headers.
type InvitationBody struct {
Goal string `json:"goal,omitempty"`
GoalCode string `json:"goal-code,omitempty"`
GoalCode string `json:"goal_code,omitempty"`
Accept []string `json:"accept,omitempty"`
}
2 changes: 1 addition & 1 deletion pkg/wallet/invitation.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type GenericInvitation struct {
From string `json:"from,omitempty"`
Label string `json:"label,omitempty"`
Goal string `json:"goal,omitempty"`
GoalCode string `json:"goal-code,omitempty"`
GoalCode string `json:"goal_code,omitempty"`
Services []interface{} `json:"services"`
Accept []string `json:"accept,omitempty"`
Protocols []string `json:"handshake_protocols,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion test/bdd/features/waci_issuance_didcomm_v1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: WACI Issuance (Go API, DIDComm V1 + Issue Credential V2)
And "Holder" creates public DID for did method "sidetree"
Then "Issuer" waits for public did to become available in sidetree for up to 10 seconds
And "Holder" waits for public did to become available in sidetree for up to 10 seconds
Then "Issuer" creates an out-of-band-v1 invitation with streamlined-vc goal-code
Then "Issuer" creates an out-of-band-v1 invitation with streamlined-vc goal_code
And "Issuer" sends the out-of-band-v1 invitation to "Holder" and they accept it
Then "Holder" sends proposal credential V2 to the "Issuer" (WACI, DIDComm V1)
And "Issuer" accepts a proposal V2 and sends an offer to the Holder (WACI, DIDComm V1)
Expand Down
2 changes: 1 addition & 1 deletion test/bdd/features/waci_issuance_didcomm_v2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: WACI Issuance (Go API, DIDComm V2 + Issue Credential V3)
And "Holder" creates public DID for did method "sidetree"
Then "Issuer" waits for public did to become available in sidetree for up to 10 seconds
And "Holder" waits for public did to become available in sidetree for up to 10 seconds
Then "Issuer" creates an out-of-band-v2 invitation with streamlined-vc goal-code
Then "Issuer" creates an out-of-band-v2 invitation with streamlined-vc goal_code
And "Issuer" sends the request to "Holder" and they accept it
Then "Holder" sends proposal credential V3 to the "Issuer" (WACI)
And "Issuer" accepts a proposal V3 and sends an offer to the Holder (WACI)
Expand Down
2 changes: 1 addition & 1 deletion test/bdd/pkg/waci/waci_issuance_didcomm_v1_sdk_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (i *IssuanceSDKDIDCommV1Steps) SetContext(ctx *context.BDDContext) {
// RegisterSteps registers the BDD test steps on the suite.
// Note that VC proofs are not checked in this test suite.
func (i *IssuanceSDKDIDCommV1Steps) RegisterSteps(suite *godog.Suite) {
suite.Step(`^"([^"]*)" creates an out-of-band-v1 invitation with streamlined-vc goal-code$`,
suite.Step(`^"([^"]*)" creates an out-of-band-v1 invitation with streamlined-vc goal_code$`,
i.createOOBV1WithStreamlinedVCGoalCode)
suite.Step(`^"([^"]*)" sends the out-of-band-v1 invitation to "([^"]*)" and they accept it$`,
i.acceptOOBV1Invitation)
Expand Down
2 changes: 1 addition & 1 deletion test/bdd/pkg/waci/waci_issuance_didcomm_v2_sdk_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (i *IssuanceSDKDIDCommV2Steps) SetContext(ctx *context.BDDContext) {
// RegisterSteps registers the BDD test steps on the suite.
// Note that VC proofs are not checked in this test suite.
func (i *IssuanceSDKDIDCommV2Steps) RegisterSteps(suite *godog.Suite) {
suite.Step(`^"([^"]*)" creates an out-of-band-v2 invitation with streamlined-vc goal-code$`,
suite.Step(`^"([^"]*)" creates an out-of-band-v2 invitation with streamlined-vc goal_code$`,
i.createOOBV2WithStreamlinedVCGoalCode)
suite.Step(`^"([^"]*)" sends the request to "([^"]*)" and they accept it$`, i.acceptOOBV2Invitation)
suite.Step(`^"([^"]*)" sends proposal credential V3 to the "([^"]*)" \(WACI\)$`, i.sendsProposalV3)
Expand Down

0 comments on commit 24b9947

Please sign in to comment.