Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
policy
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
policy
Merge requests
!22
Remove explicit user/pass credentials for MongoDB
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove explicit user/pass credentials for MongoDB
mongo-connect-testing
into
main
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Lyuben Penkovski
requested to merge
mongo-connect-testing
into
main
2 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Rely on the connection string for authentication to Mongo.
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
7d1060de
1 commit,
2 years ago
1 file
+
1
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
cmd/policy/main.go
+
1
−
5
Options
@@ -56,11 +56,7 @@ func main() {
// connect to mongo db
db
,
err
:=
mongo
.
Connect
(
context
.
Background
(),
options
.
Client
()
.
ApplyURI
(
cfg
.
Mongo
.
Addr
)
.
SetAuth
(
options
.
Credential
{
Username
:
cfg
.
Mongo
.
User
,
Password
:
cfg
.
Mongo
.
Pass
,
}),
)
options
.
Client
()
.
ApplyURI
(
cfg
.
Mongo
.
Addr
))
if
err
!=
nil
{
logger
.
Fatal
(
"error connecting to mongodb"
,
zap
.
Error
(
err
))
}
Loading