Skip to content

Loading…

No support for authorization (password) #3

Closed
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 6 additions and 2 deletions.
  1. +1 −0 AUTHORS
  2. +5 −2 redish/client.py
View
1 AUTHORS
@@ -1,2 +1,3 @@
Ask Solem <askh@opera.com>
Adam Lindsay <atl@comp.lancs.ac.uk>
+Matt Swanson <mdswanson@sep.com>
View
7 redish/client.py
@@ -21,6 +21,9 @@ class Client(object):
Must support the methods ``serialize(value)`` and
``deserialize(value)``. The default is to use
:class:`redish.serialization.Pickler`.
+ :keyword password: Password for requesting authentication
+ in a password protected Redis server.
+ Default is ``None``.
"""
@@ -31,12 +34,12 @@ class Client(object):
#serializer = anyjson
def __init__(self, host=None, port=None, db=None,
- serializer=None):
+ serializer=None, password=None):
self.host = host or self.host
self.port = port or self.port
self.serializer = serializer or self.serializer
self.db = db or self.db
- self.api = _RedisClient(self.host, self.port, self.db)
+ self.api = _RedisClient(self.host, self.port, self.db, password)
def id(self, name):
"""Return the next id for a name."""
Something went wrong with that request. Please try again.