Skip to content
Snippets Groups Projects
Commit 4b7ab41a authored by Kalin Canov's avatar Kalin Canov :fishing_pole_and_fish:
Browse files

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

Make mongodb auth mechanism configurable

See merge request gaia-x/data-infrastructure-federation-services/tsa/infohub!8
parents 9fc78424 2da57c61
No related branches found
No related tags found
No related merge requests found
Pipeline #62969 passed
......@@ -28,7 +28,7 @@ lint:
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
unit tests:
image: golang:1.19.4
image: golang:1.20.5
extends: .gotest
stage: test
tags:
......@@ -37,7 +37,7 @@ unit tests:
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck:
image: golang:1.19.4
image: golang:1.20.5
stage: test
tags:
- amd64-docker
......
......@@ -63,8 +63,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,
AuthMechanism: cfg.Mongo.AuthMechanism,
Username: cfg.Mongo.User,
Password: cfg.Mongo.Pass,
}),
)
if err != nil {
......
FROM golang:1.19.4-alpine3.17 as builder
FROM golang:1.20.5-alpine3.17 as builder
RUN apk add git
......
FROM golang:1.19.4
FROM golang:1.20.5
ENV GO111MODULE=on
......
......@@ -25,11 +25,12 @@ type httpConfig 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"`
DB string `envconfig:"MONGO_DBNAME" default:"infohub"`
Collection string `envconfig:"MONGO_COLLECTION" default:"exports"`
Addr string `envconfig:"MONGO_ADDR" required:"true"`
User string `envconfig:"MONGO_USER" required:"true"`
Pass string `envconfig:"MONGO_PASS" required:"true"`
DB string `envconfig:"MONGO_DBNAME" default:"infohub"`
Collection string `envconfig:"MONGO_COLLECTION" default:"exports"`
AuthMechanism string `envconfig:"MONGO_AUTH_MECHANISM" default:"SCRAM-SHA-1"`
}
type credentialConfig struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment