Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a redis cloud connection url with an auth password

Tags:

I'm switching over from a heroku addon to a direct redis cloud account and am a bit puzzled on how to generate the redis url with the auth info.

The old heroku add-on url was in the format of redis://rediscloud:mypassword@redis...

However in the dashboard and documentation I don't see any mention of a username to go along with the password. Do I still set rediscloud as the username in my new account and connection string. Does it even matter what I set as the username there?

like image 538
MonkeyBonkey Avatar asked Jun 03 '17 13:06

MonkeyBonkey


People also ask

How do I find my Redis Cloud URL?

Adding Redis databases to your plan To add more databases, simply access your Redise Cloud console and click the New DB button in the MY DATABASES > Manage page. The Redise Cloud console will provide you a new URL for connecting to your new Redis database.


2 Answers

I use golang (https://github.com/garyburd/redigo) and connect to aliyun cloud Redis (link: https://www.aliyun.com/product/kvstore?spm=5176.8006303.267657.7.cW2xH)

By the connect string:

redis://arbitrary_usrname:password@ipaddress:6379/0

when 0 is the database index and success

like image 61
billschen Avatar answered Oct 04 '22 17:10

billschen


At the moment (up to and including v4), Redis doesn't support users and only provides authentication against a global password. In order to be compliant with the URI RFC (https://www.rfc-editor.org/rfc/rfc3986) and based on the provisional RFC for Redis URIs (https://www.iana.org/assignments/uri-schemes/prov/redis), you can pass anything as a username, including the empty string, and it will be okay (i.e. ignored).

P.S. thanks for bringing up this obscurity in our docs, I'll see that it is amended.

like image 21
Itamar Haber Avatar answered Oct 04 '22 15:10

Itamar Haber