-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add possibility to use different passwords for Sentinel and Redis host (#1698) #3140
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0a0e9fe
Add possibility to use different passwords for sentinel and redis (#1…
doosterkamp 262b459
Use correct Sentinel properties in ConfigurationOptions.ToString()
doosterkamp b88180e
Removed unused usings
doosterkamp f5f9530
Merge branch 'StackExchange:main' into main
doosterkamp 982095e
- added sentinel user/pw fields to unit test that checks Configuratio…
doosterkamp f05f5aa
Merge branch 'main' of https://github.com/doosterkamp/StackExchange.R…
doosterkamp 42ff65c
Fix test
doosterkamp 96dcc8a
Use a private _isSentinel instead of serverType
doosterkamp b151f99
Moved Sentinel credentials usage to HandshakeAsync
doosterkamp 12e3d37
another property <-> field mixup fixed
doosterkamp 4030837
another property <-> field mixup fixed
doosterkamp 5077f0f
Moved Sentinel credentials usage back to SentinelPrimaryConnect(Async…
doosterkamp 8081aaa
Merge branch 'main' into main
doosterkamp 3ec875b
Restore CodeAnalysis using for [Experimental]; move new API entries t…
mgravell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| #nullable enable | ||
| StackExchange.Redis.ConfigurationOptions.SentinelPassword.get -> string? | ||
| StackExchange.Redis.ConfigurationOptions.SentinelPassword.set -> void | ||
| StackExchange.Redis.ConfigurationOptions.SentinelUser.get -> string? | ||
| StackExchange.Redis.ConfigurationOptions.SentinelUser.set -> void | ||
| [SER009]virtual StackExchange.Redis.Configuration.Tunnel.ConnectTransportAsync(System.Net.EndPoint! endpoint, StackExchange.Redis.ConnectionType connectionType, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<RESPite.Transports.DuplexTransport?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using System; | ||
| using Xunit; | ||
|
|
||
| namespace StackExchange.Redis.Tests; | ||
|
|
||
| public class SentinelConfigTests | ||
| { | ||
| [Fact] | ||
| public void Parse_SentinelCredentials_FromConnectionString() | ||
| { | ||
| var cs = "localhost:26379,serviceName=myprimary,sentinelUser=su,sentinelPassword=sp"; | ||
| var options = ConfigurationOptions.Parse(cs); | ||
|
|
||
| Assert.Equal("su", options.SentinelUser); | ||
| Assert.Equal("sp", options.SentinelPassword); | ||
| Assert.Equal("myprimary", options.ServiceName); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void ToString_Masks_SentinelPassword_WhenExcluded() | ||
| { | ||
| var options = new ConfigurationOptions(); | ||
| options.EndPoints.Add("localhost", 26379); | ||
| options.ServiceName = "myprimary"; | ||
| options.SentinelUser = "su"; | ||
| options.SentinelPassword = "secret"; | ||
|
|
||
| var repr = options.ToString(includePassword: false); | ||
|
|
||
| Assert.Contains("sentinelUser=su", repr); | ||
| Assert.Contains("sentinelPassword=*****", repr); | ||
| Assert.DoesNotContain("secret", repr); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Clone_Preserves_SentinelCredentials() | ||
| { | ||
| var options = new ConfigurationOptions(); | ||
| options.SentinelUser = "su"; | ||
| options.SentinelPassword = "sp"; | ||
|
|
||
| var clone = options.Clone(); | ||
|
|
||
| Assert.Equal(options.SentinelUser, clone.SentinelUser); | ||
| Assert.Equal(options.SentinelPassword, clone.SentinelPassword); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.