log4mongo / log4mongo-python

python logging handler for mongo database
http://log4mongo.org
Other
111 stars 37 forks source link

Authentication issue #16

Open drorasaf opened 8 years ago

drorasaf commented 8 years ago

MongoDB uses the admin database as the default user manager, log4mongo does not support this option.

Another question, why does the connection is not being created with the MongoClient API?

char0n commented 8 years ago

@oz123 any idea ?

oz123 commented 8 years ago

Shalom Dror, In the past mongodb, did authentication against admin. In the mean while you can really store users and passwords everywhere.

I think that using MongoClient instead of a Connection isn't such a bad idea. Can you make a PR for that?

Please note, the current logger class re-uses the connection, so make sure you are not creating multiple clients when creating multiple logging handlers (see the tests for that).

drorasaf commented 8 years ago

Hi oz, I can store passwords and users everywhere, but it creates high maintenance for the DBA. Just to verify, I will create a PR for MongoClient and the authentication.

drorasaf commented 8 years ago

What about other kinds of authorization, MongoDB currently supports multiple types, such as certificate based, any plans?

oz123 commented 8 years ago

I don't see any problem adding implementation of certificate based authentication. Would you like to it it too? As for LDAP and Kerberos, it's only available in the enterprise version, so I don't see how this can be added by me. Also, even I had an enterprise version, I would not add it in the core because it will mess up testing for other developers. So it means there will be code that can't be tested.

Thanks for the contributions so far

drorasaf commented 8 years ago

Currently, I do not have an enterprise edition either, but it could be provided for development purposes according to their site: https://www.mongodb.com/lp/download/mongodb-enterprise. which means it can be created, further more, it can be created with a relevant docker container to create easy tests, but maybe I made a huge jump:)

It can be split into a different file/test that allow this kind of authentication?

oz123 commented 8 years ago

OK. Then this is feasible. I have no objection for that. I am not in favor for involving docker for testing. It's an over kill. This package only depends on mongodb and python so setting up the test environment is not hard. I think the hardest part will be getting the binaries for the enterprise edition (manual registration and co).