Skip to content

Commit

Permalink
build(deps)!: Upgrade contracts mod to update /secret DTO
Browse files Browse the repository at this point in the history
BREAKING CHANGE: secret DTO object in core contracts uses SecretName instead of Path

Signed-off-by: Marc-Philippe Fuller <marc-philippe.fuller@intel.com>
  • Loading branch information
marcpfuller committed Feb 16, 2023
1 parent cf150bd commit 76cf874
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/http/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions internal/controller/http/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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
Expand All @@ -265,7 +265,7 @@ func TestSecretRequest(t *testing.T) {
{Key: "username", Value: ""},
}
noSecretStore := validRequest
noSecretStore.Path = "no"
noSecretStore.SecretName = "no"

tests := []struct {
Name string
Expand Down

0 comments on commit 76cf874

Please sign in to comment.