Skip to content

Commit

Permalink
[receiver/solace] Change the type of Config.Auth.PlainText.Password
Browse files Browse the repository at this point in the history
… to be `configopaque.String` (#24066)
  • Loading branch information
mackjmr committed Jul 14, 2023
1 parent 7e6145c commit 3645e07
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .chloggen/solace-use-configopaque.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.
# If your change doesn't affect end users, such as a test fix or a tooling change,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: receiver/solace

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Change the type of `Config.Auth.PlainText.Password` to be `configopaque.String`

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [17273]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
5 changes: 3 additions & 2 deletions receiver/solacereceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configtls"
)

Expand Down Expand Up @@ -68,8 +69,8 @@ type Authentication struct {

// SaslPlainTextConfig defines SASL PLAIN authentication.
type SaslPlainTextConfig struct {
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Username string `mapstructure:"username"`
Password configopaque.String `mapstructure:"password"`
}

// SaslXAuth2Config defines the configuration for the SASL XAUTH2 authentication.
Expand Down
2 changes: 1 addition & 1 deletion receiver/solacereceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/stretchr/testify v1.8.4
go.opencensus.io v0.24.0
go.opentelemetry.io/collector/component v0.81.0
go.opentelemetry.io/collector/config/configopaque v0.81.0
go.opentelemetry.io/collector/config/configtls v0.81.0
go.opentelemetry.io/collector/confmap v0.81.0
go.opentelemetry.io/collector/consumer v0.81.0
Expand All @@ -34,7 +35,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/collector/config/configopaque v0.81.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.81.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0-rcv0013 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion receiver/solacereceiver/messaging_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func toAMQPAuthentication(config *Config) (amqp.SASLType, error) {
if plaintext.Password == "" || plaintext.Username == "" {
return nil, errMissingPlainTextParams
}
return connSASLPlain(plaintext.Username, plaintext.Password), nil
return connSASLPlain(plaintext.Username, string(plaintext.Password)), nil
}
if config.Auth.XAuth2 != nil {
xauth := config.Auth.XAuth2
Expand Down

0 comments on commit 3645e07

Please sign in to comment.