Skip to content

AUTH with username and password always fails #32

@yohayg

Description

@yohayg

I have a setup that requires both username and password for memorydb in aws
redis-cli works fine: redis-cli -c -h my-redis --user my-user --pass mypassword

My redis pipline options contains both the username and password with a single blank space.
This setup doesn't seem to doesn't work:

{
  Password: fmt.Sprintf(`%s %s`, redisUser, redisPass)
}

It seems like the following code need to be changed from:

if conn.opts.Password != "" {
    req, _ = redis.AppendRequest(req, redis.Req("AUTH", conn.opts.Password))
}

to

if conn.opts.Password != "" && conn.opts.Username != ""  {
    req, _ = redis.AppendRequest(req, redis.Req("AUTH", conn.opts.Username, conn.opts.Password))
} else if conn.opts.Password != "" {
    req, _ = redis.AppendRequest(req, redis.Req("AUTH", conn.opts.Password))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions