joelittlejohn / embedmongo-maven-plugin

Maven plugin wrapper for the flapdoodle.de embedded MongoDB API
Apache License 2.0
88 stars 51 forks source link

Add Mongo authorization option to the plugin. #26

Closed chapmbk closed 11 years ago

chapmbk commented 11 years ago

This is for enhancement ticket: https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/25

joelittlejohn commented 11 years ago

Cheers Brandon. I'm going to do a small format tidy up to remove some of the changes that aren't related to authEnabled, but other than that this looks great! Thanks again for adding this!

SprimerLocal commented 11 years ago

It is great that we can start embedmongo with auth enabled now, but how is this intended to be used?

It would seem that embed mongo would have to be pre-set up with at least a full admin user in order to do anything with it when started with auth enabled, but I may be missing something. What would be really valuable is if the plugin can create a db/user based on config, but I don't believe this is supported yet.

joelittlejohn commented 11 years ago

I wondered the same :)

Check out #25, comment 20781570 from the author of this pull request.

Maybe @chapmbk can elaborate further.

chapmbk commented 11 years ago

When you start mongo with authentication, it does not enforce authentication until you create the first user. http://docs.mongodb.org/manual/reference/configuration-options/#auth

In our project, we use this plugin to start mongo. We then run a script on Mongo to set up reference data, etc...
This is done with another plugin. https://code.google.com/p/maven-mongodb-plugin/ One of the steps of the script is to create the user. After that, our Integration tests run using authentication.

SprimerLocal commented 11 years ago

Ah, localhost exception.

I can probably make that work for me in a bit of a roundabout way. Thanks for the info.