SncRedisBundle icon indicating copy to clipboard operation
SncRedisBundle copied to clipboard

Phpredis sentinel auth

Open McFistyBuns opened this issue 2 years ago • 1 comments

Please correct me if I missed something, but it doesn't look like you can pass any password to a sentinel when using Phpredis. https://github.com/snc/SncRedisBundle/blob/dc5f4438d669f1c52234f1d2b7bc558f8399c58e/src/Factory/PhpredisClientFactory.php#L124-L131 the Phpredis RedisSentinel class allows for an $auth parameter at the end.

https://github.com/phpredis/phpredis/blob/develop/sentinel.md#readme

Took me a bit to figure out why my setup was working with predis and not phpredis. I patched in the parameter for myself to pass the password from the parameters config: $options['parameters']['password'] ?? null since my cluster setup uses the same password for both. I could see a more robust path, though, in checking the dsn string for a password first in case the the sentinel and the node passwords are different.

McFistyBuns avatar Feb 09 '23 14:02 McFistyBuns

That's correct. PR welcome ;)

ostrolucky avatar Feb 09 '23 15:02 ostrolucky