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
[WIP] services: mongodb: add mongodb service #357
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #357 +/- ##
=========================================
Coverage ? 41.61%
=========================================
Files ? 78
Lines ? 8810
Branches ? 0
=========================================
Hits ? 3666
Misses ? 4719
Partials ? 425
Continue to review full report at Codecov.
|
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.
Can we also support the mongo --ssl option?
|
||
answer := s.MongoDBHandler(port, b) | ||
|
||
s.ch.Send(event.New( |
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.
Could you extract specific data in connection request, like username, password, application etc.
[service.mongodb] | ||
type="mongodb" | ||
version="2.5.1" | ||
dbs=[ {Name="My_DB", SizeOnDisk="8192", Empty="false"}, |
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.
allowed usernames and passwords?
When testing this I get:
|
--ssl is not implemented yet. |
services/mongodb/encode.go
Outdated
fn, ok := mapCommands[md.cmd] | ||
|
||
if !ok { | ||
log.Error("Error: command not implemented: %s", md.cmd) |
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 would be good to make an event here with the non existing command.
services/mongodb/mongodb_handler.go
Outdated
md.port = strconv.Itoa(port) | ||
|
||
// ev := make(map[string]interface{}) | ||
ev := make(eventLog) // what's the difference? |
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.
difference is that ev
is of type eventLog
now, otherwise it would be of type map[string]interface{}
This are two different types allthough they do the same.
services/mongodb/mongodb.go
Outdated
defer conn.Close() | ||
|
||
br := bufio.NewReader(conn) | ||
port := conn.RemoteAddr().(*net.TCPAddr).Port |
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.
You could put port
in mongodbService
then it does not have to be passed around as function argument.
Hi this would be a nice addition to have. Is there anything we can do to get this request merged ? |
No description provided.