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

Adding username as parameter for the redis authentication #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kerkmann
Copy link

Intention

I am using Authentik which is using your library. There is an open ticket for settings the Redis username. Sadly the username is not set in this library. Without fixing that issuer here, it's impossible to fix it in Authentik. ^^"

Changes

Adding the username as optional parameter.

I hope the PR is looking good, I am not a go developer. Please let me know if something is wrong/missing.

Comment on lines +146 to +155
if username != "" {
if _, err := c.Do("AUTH", password); err != nil {
c.Close()
return nil, err
}
} else {
if _, err := c.Do("AUTH", username, password); err != nil {
c.Close()
return nil, err
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You switched the call in the condition:

  • empty username calls the command using the username variable
  • a non-empty username calls the command without using the username variable

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry for the mistaken.

I don't think this PR will be accepted by the author.
The repo is inactive for such a long time.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides, I suggest that using tcp link url to include username and database index is the trick to pass through this dilemma if your library is dependent on redistore.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry for the mistaken.

I don't think this PR will be accepted by the author.
The repo is inactive for such a long time.

Yes, I am of the same opinion. Perhaps an authentik should use a different library than this one if we want to implement modern Redis features.

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

Successfully merging this pull request may close these issues.

3 participants