Skip to content

Commit 0b933e6

Browse files
committed
Add support for username/password authentication
Derived from NoneGG/aredis#186
1 parent 1068673 commit 0b933e6

File tree

8 files changed

+219
-19
lines changed

8 files changed

+219
-19
lines changed

coredis/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from coredis.connection import ClusterConnection, Connection, UnixDomainSocketConnection
44
from coredis.exceptions import (
55
AskError,
6+
AuthenticationFailureError,
7+
AuthenticationRequiredError,
8+
AuthorizationError,
69
BusyLoadingError,
710
CacheError,
811
ClusterCrossSlotError,
@@ -41,6 +44,9 @@
4144
"ConnectionPool",
4245
"ClusterConnectionPool",
4346
"AskError",
47+
"AuthenticationFailureError",
48+
"AuthenticationRequiredError",
49+
"AuthorizationError",
4450
"BusyLoadingError",
4551
"CacheError",
4652
"ClusterCrossSlotError",

coredis/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def __init__(
140140
host="localhost",
141141
port=6379,
142142
db=0,
143+
username=None,
143144
password=None,
144145
stream_timeout=None,
145146
connect_timeout=None,
@@ -164,6 +165,7 @@ def __init__(
164165
if not connection_pool:
165166
kwargs = {
166167
"db": db,
168+
"username": username,
167169
"password": password,
168170
"encoding": encoding,
169171
"stream_timeout": stream_timeout,

0 commit comments

Comments
 (0)