From 76cf874e5a4c502767114360369306a3defd879c Mon Sep 17 00:00:00 2001 From: Marc-Philippe Fuller Date: Wed, 15 Feb 2023 13:48:18 -0800 Subject: [PATCH] build(deps)!: Upgrade contracts mod to update /secret DTO BREAKING CHANGE: secret DTO object in core contracts uses SecretName instead of Path Signed-off-by: Marc-Philippe Fuller --- go.mod | 2 +- go.sum | 4 ++-- internal/controller/http/common.go | 2 +- internal/controller/http/common_test.go | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 27bc720a4..c5ea3f17d 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 2fc87386d..6d4d8f989 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 37eca3863..4884645ca 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 } diff --git a/internal/controller/http/common_test.go b/internal/controller/http/common_test.go index 5afe5b66b..061bae869 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