Add MONGO-CR authentication support

The following Pull Request includes code changes that will add MONGO-CR authentication support.
Hmm.  What's there now should be right.

Most of the time, we will have a Document that does not have it's own
config_auth parameter.  In this case, the username and password coming in
will be empty.  If the username and password come in empty, then the
default Mongo.config_auth will be used.  If no Mongo.config_auth was
declared from the beginning, then it's assumed that all database
connections won't be authenticated.  All authenticate() calls will be
ignored.


On Thu, Jun 19, 2014 at 11:45 AM, shakefu <notifications@github.com> wrote:

> In humbledb/mongo.py:
>
> > @@ -113,6 +121,38 @@ def reconnect(cls):
> >              cls._connection.disconnect()
> >          cls._connection = cls._new_connection()
> >
> > +    def authenticate(cls, database, username=None, password=None):
> > +        """ Delegates authentication to be the responsibility of the
> > +            context manager.
> > +            .. versionadded: 5.2.0
> > +        """
> > +        # Having no credentials makes this call a noop.
> > +        if not cls.config_auth:
>
> Pretty sure this line should be:
>
> if not cls.config_auth and not username and password:
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/shakefu/humbledb/pull/4/files#r13985911>.
>



-- 

[image: Paul Nues on about.me]

Paul Nues
about.me/paul.nues
  <http://about.me/paul.nues>