redis-py icon indicating copy to clipboard operation
redis-py copied to clipboard

WRONGPASS response doesn't raise AuthenticationError exception

Open lucacillario opened this issue 3 years ago • 0 comments

Pull Request check-list

Please make sure to review and check all of these items:

  • [x] Does $ tox pass with this change (including linting)?
  • [x] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • [x] Is the new or changed code fully tested?
  • [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • [ ] Is there an example added to the examples folder (if applicable)?
  • [ ] Was the change added to CHANGES file?

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

Newer versions of Redis (>= 6.0) have introduced new authentication errors, which are currently not handled in redis-py:

  • "-ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?", instead of "-ERR Client sent AUTH, but no password is set"
  • "-WRONGPASS invalid username-password pair or user is disabled." instead of "-ERR invalid password"

In these cases a ResponseError was raised, instead of an AuthenticationError.

Closes #2325

lucacillario avatar Aug 09 '22 17:08 lucacillario