Skip to content
Snippets Groups Projects
Commit f65c091a authored by Yordan Kinkov's avatar Yordan Kinkov
Browse files

Merge branch 'make-mongodb-auth-mechanism-configurable' into 'main'

Make mongodb auth mechanism configurable.

See merge request eclipse/xfsc/tsa/task!4
parents 6742880b 8faf897e
No related branches found
No related tags found
No related merge requests found
......@@ -64,8 +64,9 @@ func main() {
db, err := mongo.Connect(
context.Background(),
options.Client().ApplyURI(cfg.Mongo.Addr).SetAuth(options.Credential{
Username: cfg.Mongo.User,
Password: cfg.Mongo.Pass,
Username: cfg.Mongo.User,
Password: cfg.Mongo.Pass,
AuthMechanism: cfg.Mongo.AuthMechanism,
}),
)
if err != nil {
......
......@@ -32,9 +32,10 @@ type authConfig struct {
}
type mongoConfig struct {
Addr string `envconfig:"MONGO_ADDR" required:"true"`
User string `envconfig:"MONGO_USER" required:"true"`
Pass string `envconfig:"MONGO_PASS" required:"true"`
Addr string `envconfig:"MONGO_ADDR" required:"true"`
User string `envconfig:"MONGO_USER" required:"true"`
Pass string `envconfig:"MONGO_PASS" required:"true"`
AuthMechanism string `envconfig:"MONGO_AUTH_MECHANISM" default:"SCRAM-SHA-1"`
}
type policyConfig struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment