Repository: edgexfoundry/device-sdk-go
Pull request #1326 (2023-02-15 23:20:38)

build(deps)!: Upgrade contracts mod to update /secret DTO
<!-- Expected Commit Message Description (imported automatically by GitHub) -->
<!-- Must conform to [conventional commits guidelines](https://github.com/edgexfoundry/device-sdk-go/blob/main/.github/Contributing.md) -->
<!-- Expected Commit message must contain Closes/Fixes #IssueNumber statement when there is a related issue -->

<!-- Add additional detailed description of need for change if no related issue -->

**If your build fails** due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-sdk-go/blob/main/.github/Contributing.md

## PR Checklist
Please check if your PR fulfills the following requirements:

- [ ] I am not introducing a breaking change (if you are, flag in conventional commit message with `BREAKING CHANGE:` describing the break)
- [x] I am not introducing a new dependency (add notes below if you are)
- [ ] I have added unit tests for the new feature or bug fix (if not, why?) N/A
- [x] I have fully tested (add details below) this the new feature or bug fix (if not, why?)
- [ ] I have opened a PR for the related docs change (if not, why?)N/A
  <link to docs PR>

## Testing Instructions
`make test`

## New Dependency Instructions (If applicable)
<!-- Please follow [vetting instructions](https://wiki.edgexfoundry.org/display/FA/Vetting+Process+for+3rd+Party+Dependencies) and place results here -->


Patch:
diff --git a/go.mod b/go.mod
index 27bc720a..c5ea3f17 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.18
 require (
 	github.com/OneOfOne/xxhash v1.2.8
 	github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24
-	github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14
+	github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.15
 	github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9
 	github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3
 	github.com/google/uuid v1.3.0
diff --git a/go.sum b/go.sum
index 2fc87386..6d4d8f98 100644
--- a/go.sum
+++ b/go.sum
@@ -32,8 +32,8 @@ github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24 h1:H9MC0ahbkMw4w1SHeX6
 github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.24/go.mod h1:iv/czxi4ciFWMgrO+3nnanGfkT2X1QW5L3iCb+deewk=
 github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3 h1:0Ew4PzLSFJ+sb7AYtvb9m1mRN45Sh0ELU1HdMCel5t8=
 github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.3/go.mod h1:ESOWI4GokQfQ3Bn2hGsdfOVx5idj7QEdCPT/SAQDd9M=
-github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14 h1:o7CFEIyKn/quin5lrAlUbUu9x1dnecK0tZs5waLhdCc=
-github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.14/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
+github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.15 h1:0fPmT+Jm2scrs9iQLX9dNTAaCPXn6fiTCwiYhcTc0fc=
+github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.15/go.mod h1:4lpZUM54ZareGU/yuAJvLEw0BoJ43SvCj1LO+gsKm9c=
 github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9 h1:CUUieXQ8roD4M770GXj1he707V3V9Jiygk302+dwvKk=
 github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.9/go.mod h1:iKBxmZkc7jdOrT99+IR1nyg7PlRgooAQMhZxDh2mTUQ=
 github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 h1:QgZF9f70Cwpvkjw3tP1aiVGHc+yNFJNzW6hO8pDs3fg=
diff --git a/internal/controller/http/common.go b/internal/controller/http/common.go
index 37eca386..4884645c 100644
--- a/internal/controller/http/common.go
+++ b/internal/controller/http/common.go
@@ -94,7 +94,7 @@ func (c *RestController) prepareSecret(request commonDTO.SecretRequest) (string,
 		secretKVs[secret.Key] = secret.Value
 	}
 
-	path := strings.TrimSpace(request.Path)
+	path := strings.TrimSpace(request.SecretName)
 
 	return path, secretKVs
 }


Test patch:
diff --git a/internal/controller/http/common_test.go b/internal/controller/http/common_test.go
index 5afe5b66..061bae86 100644
--- a/internal/controller/http/common_test.go
+++ b/internal/controller/http/common_test.go
@@ -238,7 +238,7 @@ func TestSecretRequest(t *testing.T) {
 
 	validRequest := commonDTO.SecretRequest{
 		BaseRequest: commonDTO.NewBaseRequest(),
-		Path:        "mqtt",
+		SecretName:  "mqtt",
 		SecretData: []commonDTO.SecretDataKeyValue{
 			{Key: "username", Value: "username"},
 			{Key: "password", Value: "password"},
@@ -247,9 +247,9 @@ func TestSecretRequest(t *testing.T) {
 	validRequest.RequestId = expectedRequestId
 
 	NoPath := validRequest
-	NoPath.Path = ""
+	NoPath.SecretName = ""
 	validPathWithSlash := validRequest
-	validPathWithSlash.Path = "mqtt"
+	validPathWithSlash.SecretName = "mqtt"
 	validNoRequestId := validRequest
 	validNoRequestId.RequestId = ""
 	badRequestId := validRequest
@@ -265,7 +265,7 @@ func TestSecretRequest(t *testing.T) {
 		{Key: "username", Value: ""},
 	}
 	noSecretStore := validRequest
-	noSecretStore.Path = "no"
+	noSecretStore.SecretName = "no"
 
 	tests := []struct {
 		Name               string