feat: Add support for custom Redis Cluster users

This introduces the ability to specify a custom username for authenticating with Redis Clusters.
pull/21244/head
jim02.he 8 months ago
parent 9e73e8b9e8
commit 2065b092c5

@ -84,6 +84,11 @@ class RedisConfig(BaseSettings):
default=None,
)
REDIS_CLUSTERS_USERNAME: Optional[str] = Field(
description="Username for Redis Clusters authentication (Required if a custom username is used)",
default=None,
)
REDIS_SERIALIZATION_PROTOCOL: int = Field(
description="Redis serialization protocol (RESP) version",
default=3,

@ -96,6 +96,7 @@ def init_app(app: DifyApp):
redis_client.initialize(
RedisCluster(
startup_nodes=nodes,
username=dify_config.REDIS_CLUSTERS_USERNAME,
password=dify_config.REDIS_CLUSTERS_PASSWORD,
protocol=resp_protocol,
cache_config=clientside_cache_config,

Loading…
Cancel
Save