Skip to content

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

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

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • 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)?

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

Description of change

Please provide a description of the change here.

…ive 'problem with LDAP service' response from server.
@petyaslavova petyaslavova added the feature New feature label Oct 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new ExternalAuthProviderError exception to handle authentication errors from external providers like LDAP. When the Redis server returns a "problem with LDAP service" error message, the client will now raise this specific exception instead of a generic error.

Key changes:

  • Added new ExternalAuthProviderError exception class
  • Updated error parser to detect and raise the new exception for LDAP service errors
  • Added comprehensive test coverage with mock socket implementation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
redis/exceptions.py Defines the new ExternalAuthProviderError exception class
redis/_parsers/base.py Integrates the new exception into the error parsing logic
tests/test_parsers/test_errors.py Adds test suite with mock Redis protocol implementation
tests/conftest.py Adds utility function to skip tests when hiredis parser is available

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pytest.mark.parametrize("protocol_version", [2, 3])
def test_external_auth_provider_error(self, protocol_version):
client = Redis(
protocol=protocol_version,
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

[nitpick] Missing decode_responses parameter initialization. Consider explicitly setting this to False or True to make the test's expectations clear and avoid relying on default behavior.

Suggested change
protocol=protocol_version,
protocol=protocol_version,
decode_responses=False,

Copilot uses AI. Check for mistakes.

@petyaslavova petyaslavova merged commit 68483c1 into master Oct 21, 2025
104 of 106 checks passed
@petyaslavova petyaslavova deleted the ps_add_new_external_auth_provider_error_type branch October 21, 2025 16:45
petyaslavova added a commit that referenced this pull request Oct 21, 2025
…ive 'problem with LDAP service' response from server. (#3808)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants