diff --git a/auth_server/authn/tokendb_redis.go b/auth_server/authn/tokendb_redis.go index 39a4f10a..f6902b37 100644 --- a/auth_server/authn/tokendb_redis.go +++ b/auth_server/authn/tokendb_redis.go @@ -30,7 +30,7 @@ import ( ) type RedisStoreConfig struct { - ClientOptions *redis.Options `yaml:"redis_options,omitempty"` + ClientOptions *redis.UniversalOptions `yaml:"redis_options,omitempty"` ClusterOptions *redis.ClusterOptions `yaml:"redis_cluster_options,omitempty"` TokenHashCost int `yaml:"token_hash_cost,omitempty"` } @@ -51,7 +51,7 @@ func NewRedisTokenDB(options *RedisStoreConfig) (TokenDB, error) { } client = redis.NewClusterClient(options.ClusterOptions) } else { - client = redis.NewClient(options.ClientOptions) + client = redis.NewUniversalClient(options.ClientOptions) } tokenHashCost := options.TokenHashCost if tokenHashCost <= 0 { diff --git a/examples/reference.yml b/examples/reference.yml index ce741d06..547ebca6 100644 --- a/examples/reference.yml +++ b/examples/reference.yml @@ -144,11 +144,13 @@ github_auth: # or Redis, redis_token_db: redis_options: - # with a single instance, - addr: localhost:6379 - redis_cluster_options: - # or in the cluster mode. - addrs: ["localhost:7000"] + # with a single instance, + addr: localhost:6379 + # or in the cluster mode. + addrs: ["localhost:7000"] + # or in the failover mode with redis sentinel. + mastername: redis-ha + sentineladdrs: ["redis-sentinel:26379"] # How long to wait when talking to GitHub servers. Optional. http_timeout: "10s" # How long to wait before revalidating the GitHub token. Optional. @@ -221,9 +223,11 @@ gitlab_auth: redis_options: # with a single instance, addr: localhost:6379 - redis_cluster_options: # or in the cluster mode. addrs: ["localhost:7000"] + # or in the failover mode with redis sentinel. + mastername: redis-ha + sentineladdrs: ["redis-sentinel:26379"] # How long to wait when talking to GitLab servers. Optional. http_timeout: "10s" # How long to wait before revalidating the Gitlab token. Optional.