Skip to content

Commit

Permalink
Add support for username/password authentication
Browse files Browse the repository at this point in the history
Derived from NoneGG/aredis#186
  • Loading branch information
alisaifee committed Jan 17, 2022
1 parent 1068673 commit 93a28fe
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 19 deletions.
6 changes: 6 additions & 0 deletions coredis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from coredis.connection import ClusterConnection, Connection, UnixDomainSocketConnection
from coredis.exceptions import (
AskError,
AuthenticationFailureError,
AuthenticationRequiredError,
AuthorizationError,
BusyLoadingError,
CacheError,
ClusterCrossSlotError,
Expand Down Expand Up @@ -41,6 +44,9 @@
"ConnectionPool",
"ClusterConnectionPool",
"AskError",
"AuthenticationFailureError",
"AuthenticationRequiredError",
"AuthorizationError",
"BusyLoadingError",
"CacheError",
"ClusterCrossSlotError",
Expand Down
2 changes: 2 additions & 0 deletions coredis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def __init__(
host="localhost",
port=6379,
db=0,
username=None,
password=None,
stream_timeout=None,
connect_timeout=None,
Expand All @@ -164,6 +165,7 @@ def __init__(
if not connection_pool:
kwargs = {
"db": db,
"username": username,
"password": password,
"encoding": encoding,
"stream_timeout": stream_timeout,
Expand Down
Loading

0 comments on commit 93a28fe

Please sign in to comment.