python-socketio
python-socketio copied to clipboard
redis_manager.py can not validate redis password correctly when use redis.Redis.from_url()
I use redis as queue, and my redis password contain some special symbol, like '@', '#' and so on. I find redis_manager.py can not parse my redis password correctly, because from_url(redis_url) function missed a decode_components argument. I readed python-redis source code, and geted this argument default is False, but i think python-socket can supply this argument to set decode_components = True. So i was troubled by this problem, and i must change my redis password?
Why can't you pass your redis URL already decoded?
For example, my redis url is "redis://:123@#!@localhost:6379/0", and then i use SocketIO(app, message_queue=redis_url) to initialize, what happened is that socketio can not connect redis server.
Did you try a urlencoded URL, such as redis://123%40%23%21@localhost:6379/0? This isn't really a problem with this package, the URL that you pass is sent into the redis package as is.
Yes, i had tried to use "redis://123%40%23%21@localhost:6379/0", but redis return invalid password. So i had to read redis(python package) source code and found decode_components argument. If i pass the url "redis://123%40%23%21@localhost:6379/0" to python redis package, I must set decode_components argument is True.
Okay, I think I understand. I wonder why they chose to disable urldecoding by default...
The decode_components=True option can be passed as an extra option when creating the RedisManager class instance and then Redis will apply urldecode to the passed URL.