Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseConnectInfo parses the uri wrong #215

Open
teto opened this issue Aug 23, 2023 · 1 comment
Open

parseConnectInfo parses the uri wrong #215

teto opened this issue Aug 23, 2023 · 1 comment
Assignees

Comments

@teto
Copy link

teto commented Aug 23, 2023

Hedis doesn't seem to interpret the redis uri like redis-cli does

expected by redis-cli -u since informatikr/hedis doesn't interpret it the same way as redis-cli (hedis will parse password as the username in redis://password@localhost while redis-cli uses it as password-) but I could not find it anywhere.

To reproduce start redis-server with something like

appendOnly no
appendfsync everysec
bind 127.0.0.1
daemonize no
databases 16
dbfilename dump.rdb
dir /var/lib/redis-test
logfile stdout
loglevel notice
maxclients 10000
port 6379
requirepass toto

Then you can connect via redis-cli -u redis://toto@localhost but passing the same redis://toto@localhost to parseConnectInfo, "toto" gets parsed as the username instead of the password.

NB: the iana link seems to be the official spec, I had a hard time finding a reference on redis docs redis/redis-doc#2523

@qnikst
Copy link
Collaborator

qnikst commented Dec 11, 2023

Actually I'm a bit confused, according to RFC and general URI scheme authority is [user:[password]]@ and password seems deprecated according to rfc3986.

Still I see that redis upstream uses [[user:]password@ scheme. To avoid further confusion I think I'll implement spec as per https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax. It looks solid and covers usual connection, TLS, sentinel.

@qnikst qnikst self-assigned this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants