ratelimit icon indicating copy to clipboard operation
ratelimit copied to clipboard

REDIS_AUTH does not work with sentinel

Open p53 opened this issue 5 years ago • 4 comments
trafficstars

as used right now REDIS_AUTH is not used for authentication when using sentinel type, you have to encode password in redis uri in REDIS_URL variable, this should be fixed or mentioned in documentation

p53 avatar Oct 27 '20 09:10 p53

Maybe

diff --git a/src/redis/driver_impl.go b/src/redis/driver_impl.go
index 18e213f..272803c 100644
--- a/src/redis/driver_impl.go
+++ b/src/redis/driver_impl.go
@@ -109,7 +109,7 @@ func NewClientImpl(scope stats.Scope, useTls bool, auth string, redisType string
 		if len(urls) < 2 {
 			panic(RedisError("Expected master name and a list of urls for the sentinels, in the format: <redis master name>,<sentinel1>,...,<sentineln>"))
 		}
-		client, err = radix.NewSentinel(urls[0], urls[1:], radix.SentinelPoolFunc(poolFunc))
+		client, err = radix.NewSentinel(urls[0], urls[1:], radix.SentinelConnFunc(df), radix.SentinelPoolFunc(poolFunc))
 	default:
 		panic(RedisError("Unrecognized redis type " + redisType))
 	}

kari-awake avatar Nov 25 '20 08:11 kari-awake

What is the syntax to encode the password into the REDIS_URL variable?

DanTulovsky avatar Feb 14 '22 21:02 DanTulovsky

redis://:p455w0rd@localhost:9376 apparently..

DanTulovsky avatar Feb 14 '22 21:02 DanTulovsky

Indeed, I can also confirm this issue from my side. I also think that current documentation should mention this.

This is an open point. Are PR's welcome in this case for fixing this issue on the radix client side @vsabella?

alperdedeoglu avatar Sep 30 '23 21:09 alperdedeoglu