-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve MongoDB connection string matching #1550
Conversation
ee65d94
to
284590e
Compare
284590e
to
a6652c0
Compare
7f1b02e
to
ff9db3a
Compare
707b6bd
to
daf8947
Compare
daf8947
to
c36c649
Compare
add3140
to
b6ceaa2
Compare
@zricethezav this should be ready for review now. |
8f434af
to
c71f2d7
Compare
c71f2d7
to
1963c0c
Compare
f2732cf
to
159f012
Compare
159f012
to
b3eefba
Compare
b3eefba
to
cbfa5dd
Compare
3ac447e
to
6b52a69
Compare
99d7bf9
to
4005150
Compare
b98c69e
to
e547cf5
Compare
234c262
to
3e7540d
Compare
3e7540d
to
4a2d134
Compare
4a2d134
to
8f0059c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rgmz, sorry for just seeing this PR. Thanks for the detailed test cases. I’ve added some test credentials, and the tests are all passing.
pkg/detectors/mongodb/mongodb.go
Outdated
if !isErrDeterminate(err) { | ||
isVerified, verificationErr := verifyUri(ctx, resMatch, timeout) | ||
s1.Verified = isVerified | ||
if !isErrDeterminate(verificationErr) { | ||
s1.SetVerificationError(err, resMatch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this should be verificationErr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It absolutely should be.
This mostly fixes #1512, although it would be valuable to add real secrets to test verification of multiple hosts, connection options, etc.