Skip to content

Commit

Permalink
add using configopaque.String instead string for auth.password
Browse files Browse the repository at this point in the history
  • Loading branch information
go-follow committed Nov 18, 2023
1 parent 2c04534 commit c2492f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion exporter/cassandraexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

package cassandraexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/cassandraexporter"
import "go.opentelemetry.io/collector/config/configopaque"

type Config struct {
DSN string `mapstructure:"dsn"`
Expand All @@ -24,6 +25,6 @@ type Compression struct {
}

type Auth struct {
UserName string `mapstructure:"username"`
UserName string `mapstructure:"username"`
Password configopaque.String `mapstructure:"password"`
}
2 changes: 1 addition & 1 deletion exporter/cassandraexporter/exporter_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func newLogsExporter(logger *zap.Logger, cfg *Config) (*logsExporter, error) {
if cfg.Auth.UserName != "" && cfg.Auth.Password != "" {
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: cfg.Auth.UserName,
Password: cfg.Auth.Password,
Password: string(cfg.Auth.Password),
}
}
session, err := cluster.CreateSession()
Expand Down
2 changes: 1 addition & 1 deletion exporter/cassandraexporter/exporter_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func newTracesExporter(logger *zap.Logger, cfg *Config) (*tracesExporter, error)
if cfg.Auth.UserName != "" && cfg.Auth.Password != "" {
cluster.Authenticator = gocql.PasswordAuthenticator{
Username: cfg.Auth.UserName,
Password: cfg.Auth.Password,
Password: string(cfg.Auth.Password),
}
}
session, err := cluster.CreateSession()
Expand Down

0 comments on commit c2492f0

Please sign in to comment.