Add working credentials configs for non cluster mode#27378
Draft
auden-woolfson wants to merge 1 commit intomasterfrom
Draft
Add working credentials configs for non cluster mode#27378auden-woolfson wants to merge 1 commit intomasterfrom
auden-woolfson wants to merge 1 commit intomasterfrom
Conversation
Contributor
Reviewer's GuideAdds configurable Redis username/password credentials to RedisProviderConfig and updates non-cluster Redis client creation to build a RedisURI with optional authentication instead of using the raw server URI string. Sequence diagram for non-cluster Redis client creation with optional credentialssequenceDiagram
participant Config as RedisProviderConfig
participant Factory as RedisClusterAsyncCommandsFactory
participant Builder as RedisURI_Builder
participant Client as RedisClient
Config-->>Factory: getRedisClient(redisProviderConfig)
Factory->>Config: getServerUri()
Config-->>Factory: serverUriString
Factory->>Factory: parse serverUriString to serverUri
Factory->>Builder: RedisURI.builder()
Factory->>Builder: withHost(serverUri.host)
Factory->>Builder: withPort(serverUri.port)
Factory->>Config: getRedisUsername()
Config-->>Factory: username or null
Factory->>Config: getRedisPassword()
Config-->>Factory: password or null
alt password is present and username is present
Factory->>Builder: withAuthentication(username, password)
else password is present and username is null
Factory->>Builder: withPassword(password)
else password is null
Factory->>Builder: no authentication
end
Factory->>Builder: build()
Builder-->>Factory: redisUri
Factory->>Client: create(redisUri)
Client-->>Factory: redisClient
Factory-->>Config: return redisClient
Class diagram for updated RedisProviderConfig and RedisClusterAsyncCommandsFactoryclassDiagram
class RedisProviderConfig {
- long totalSetTimeoutMs
- String credentialsPath
- String redisPropertiesPath
- String redisUsername
- String redisPassword
+ boolean isClusterModeEnabled()
+ RedisProviderConfig setClusterModeEnabled(boolean value)
+ String getServerUri()
+ String getCredentialsPath()
+ RedisProviderConfig setRedisUsername(String value)
+ String getRedisUsername()
+ RedisProviderConfig setRedisPassword(String value)
+ String getRedisPassword()
}
class RedisClusterAsyncCommandsFactory {
+ RedisClusterClient getRedisClusterClient(RedisProviderConfig redisProviderConfig)
+ RedisClient getRedisClient(RedisProviderConfig redisProviderConfig)
+ RedisClusterAsyncCommands getRedisClusterAsyncCommands(RedisProviderConfig redisProviderConfig, RedisClusterClient redisClusterClient)
}
class RedisClient {
+ create(RedisURI redisUri)
}
class RedisURI {
<<builder>>
+ builder() RedisURI_Builder
}
class RedisURI_Builder {
+ withHost(String host) RedisURI_Builder
+ withPort(int port) RedisURI_Builder
+ withAuthentication(String username, String password) RedisURI_Builder
+ withPassword(String password) RedisURI_Builder
+ build() RedisURI
}
RedisClusterAsyncCommandsFactory ..> RedisProviderConfig : uses
RedisClusterAsyncCommandsFactory ..> RedisClient : creates
RedisClusterAsyncCommandsFactory ..> RedisURI_Builder : builds
RedisClient ..> RedisURI : depends on
RedisURI_Builder ..> RedisURI : builds
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use:
Summary by Sourcery
Add configurable Redis username and password support for the Redis HBO provider and wire them into non-cluster Redis client creation.
New Features: