Skip to content

Commit 03cc7d4

Browse files
committed
rebase: add password support to conn
1 parent 7d72d65 commit 03cc7d4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

waterbutler/server/api/v1/provider/ratelimiting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def __init__(self):
1919

2020
self.WINDOW_SIZE = settings.RATE_LIMITING_FIXED_WINDOW_SIZE
2121
self.WINDOW_LIMIT = settings.RATE_LIMITING_FIXED_WINDOW_LIMIT
22-
self.redis_conn = Redis(host=settings.REDIS_DOMAIN, port=settings.REDIS_PORT)
22+
self.redis_conn = Redis(host=settings.REDIS_DOMAIN, port=settings.REDIS_PORT,
23+
password=settings.REDIS_PASSWORD)
2324

2425
def rate_limit(self):
2526
""" Check with the WB Redis server on whether to rate-limit a request. Returns a tuple.

waterbutler/server/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
ENABLE_RATE_LIMITING = config.get_bool('ENABLE_RATE_LIMITING', False)
3737
REDIS_DOMAIN = config.get('REDIS_DOMAIN', '192.168.168.167')
3838
REDIS_PORT = config.get('REDIS_PORT', '6379')
39+
REDIS_PASSWORD = config.get('REDIS_PASSWORD', None)
3940

4041
# Number of seconds until the redis key expires
4142
RATE_LIMITING_FIXED_WINDOW_SIZE = int(config.get('RATE_LIMITING_FIXED_WINDOW_SIZE', 3600))

0 commit comments

Comments
 (0)