Skip to content

feat redis: add sentinel_password option #925

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

Closed

Conversation

tysion
Copy link
Contributor

@tysion tysion commented Apr 26, 2025

This PR adds support for password authentication when connecting to Redis Sentinel.

Closes #924.

Allows configuring Sentinel password via sentinel_password option in secdist config.
Example:

{
    "redis_settings": {
        "taxi-tmp": {
            "password": "redispwd",
            "sentinel_password": "sentpwd",  /* <---- `AUTH sentpwd` will be executed on connection to sentinel`
            "database_index": 5,
            "secure_connection": false,
            "shards": [
                {
                    "name": "mymaster"
                }
            ],
            "sentinels": [
                {
                    "host": "127.0.0.1",
                    "port": 26379
                }
            ]
        }
    }
}

Note: by creating a PR or an issue you automatically agree to the CLA. See CONTRIBUTING.md. Feel free to remove this note, the agreement holds.

tysion added 2 commits April 26, 2025 22:41
@tysion tysion requested a review from segoon as a code owner April 26, 2025 22:42
Copy link
Member

@apolukhin apolukhin left a comment

Choose a reason for hiding this comment

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

Many thanks, looks great!

A few comments follow:


for (const auto& sentinel : sentinels) {
EXPECT_TRUE(sentinel->WaitForFirstPingReply(kSmallPeriod));
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add a subscribe test too

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.

Support Sentinel authentication with AUTH command
3 participants