ledgetech / lua-resty-redis-connector

Connection utilities for lua-resty-redis
234 stars 71 forks source link

Add support for usernames (Redis ACL) #40

Closed piotrp closed 3 years ago

piotrp commented 3 years ago

This adds support for username / sentinel_username parameters which are used to authenticate using new form of AUTH command from Redis 6.0.

From what I see travis.yml uses Trusty (i.e. Redis 2.8), so I didn't add tests covering this. I can include tests that assume Redis 6+ is installed, but I never used Travis so I'm not sure i can easily upgrade it.

If you need, I tested in Docker environemnt and installed newest Redis using:

RUN echo "deb http://ppa.launchpad.net/redislabs/redis/ubuntu focal main" > /etc/apt/sources.list.d/redis.list && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 60A0586666DE0BA4B481628ACC59E6B43FA6E3CA && \
    apt-get update -oDir::Etc::sourcelist=sources.list.d/redis.list -o Dir::Etc::sourceparts=- --no-list-cleanup && \
    apt-get install -y redis redis-sentinel
piotrp commented 3 years ago

Redis in CI updated to current one from Redis Labs (6.2.3 at the moment), tests added.

pintsized commented 3 years ago

Looks great, thanks for this!