Skip to content
Snippets Groups Projects
Commit 6e27d934 authored by Lyuben Penkovski's avatar Lyuben Penkovski
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/policy!23
parents 1361d458 15794a93
No related branches found
No related tags found
No related merge requests found
Pipeline #62934 passed with stages
in 5 minutes and 1 second
......@@ -30,7 +30,7 @@ lint:
before_script: []
unit tests:
image: golang:1.20.4
image: golang:1.20.5
extends: .gotest
stage: test
tags:
......@@ -39,7 +39,7 @@ unit tests:
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck:
image: golang:1.20.4
image: golang:1.20.5
stage: test
tags:
- amd64-docker
......
......@@ -81,8 +81,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.20.4-alpine3.17 as builder
FROM golang:1.20.5-alpine3.17 as builder
RUN apk add git
......
FROM golang:1.20.4
FROM golang:1.20.5
RUN go install github.com/ysmood/kit/cmd/guard@v0.25.11
......
......@@ -44,11 +44,12 @@ type didResolverConfig 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:"policy"`
Collection string `envconfig:"MONGO_COLLECTION" default:"policies"`
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:"policy"`
Collection string `envconfig:"MONGO_COLLECTION" default:"policies"`
AuthMechanism string `envconfig:"MONGO_AUTH_MECHANISM" default:"SCRAM-SHA-1"`
}
type metricsConfig 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