Support username for redis auth
It seems parsing a redis url of the form redis:://user:password@host fails (while it works without the user
From the tests, I have these passing:
expect_equal(parse_redis_url("localhost"),
f("localhost"))
expect_equal(parse_redis_url("redis://localhost"),
f("localhost", scheme = "redis"))
expect_equal(parse_redis_url("redis://localhost:999"),
f("localhost", scheme = "redis", port = 999L))
expect_equal(parse_redis_url("redis://:foo@localhost:999"),
f("localhost", scheme = "redis", port = 999L,
password = "foo"))
expect_equal(parse_redis_url("redis://:foo@localhost:999/2"),
f("localhost", scheme = "redis", port = 999L,
password = "foo", db = 2L))
expect_equal(parse_redis_url("redis://127.0.0.1:999"),
f("127.0.0.1", scheme = "redis", port = 999L))
This was written ~9 years ago, and I don't recall if this was following redis-cli or some RFC or what it was derived from. Try with the empty username form, though you'll need the port too from the look of it. Making the parser more flexible looks relatively straightforward and I'd welcome a PR that made this easier to to work with.
Username support was added rather recently to redis afaik (within the last few years). We used to use password only auth at my company (which worked fine with redux), now we switched to username-password. tbh i'm not sure if i'll be able to test it soon, but if i am i'll do a pr.
I have exactly the same problem. I tried to send the command directly using command("AUTH user password") after a simple connection using (host, port) but always get error saying that the number of argument is wrong. When getting connection info it seems that it connect using API protocol level 5 which at some point check the command and it's parameters. AUTH with an optional user has been introduced with ACL in version 6. I tried to find where the check is done and did not succeed. I tried also using RcppRedis which is more basic than redux which has the same limitations but was easier to modify. The modifications are working. If you want to have a look see https://github.com/billy34/rcppredis/tree/add-commands Hope it helps
I am part way through a maintenance release but I've added a section to the docs on how to use $command() to run arbitrary commands as I realise that is not documented anywhere. That should help in the short term as you can send anything you want to the server.
Once that's done I will take a look at supporting the commands added in recent versions - upstream have changed the json format that the commands are documented in, which is good and bad - bad because it means that the existing generation approach will not work, but good because it resolves some ambiguities that I could not work around previously. ETA on this would late September probably, but I may have something to try before then