Skip to content

Commit

Permalink
fix: Remove MessageBus Options data from configuration after client c…
Browse files Browse the repository at this point in the history
…reated (#4016)

fixes #4015

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
  • Loading branch information
Lenny Goodell authored May 10, 2022
1 parent fefff5d commit 1da0004
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/core/data/messaging/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import (
"github.com/edgexfoundry/go-mod-messaging/v2/messaging"
"github.com/edgexfoundry/go-mod-messaging/v2/pkg/types"

"github.com/edgexfoundry/edgex-go/internal/core/data/container"
bootstrapContainer "github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/container"
bootstrapMessaging "github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/messaging"
"github.com/edgexfoundry/go-mod-bootstrap/v2/bootstrap/startup"
"github.com/edgexfoundry/go-mod-bootstrap/v2/di"

"github.com/edgexfoundry/edgex-go/internal/core/data/container"
)

// BootstrapHandler fulfills the BootstrapHandler contract. if enabled, tt creates and initializes the Messaging client
Expand Down Expand Up @@ -101,6 +102,9 @@ func BootstrapHandler(ctx context.Context, wg *sync.WaitGroup, startupTimer star
messageBusInfo.PublishTopicPrefix,
messageBusInfo.AuthMode)

// Make sure the MessageBus password is not leaked into the Service Config that can be retrieved via the /config endpoint
delete(messageBusInfo.Optional, bootstrapMessaging.OptionsPasswordKey)

return true
}
}
Expand Down

0 comments on commit 1da0004

Please # to comment.