From cedba29b8dbeaaec455f5fbac0d9fc644934320f Mon Sep 17 00:00:00 2001 From: Adrian Liunardo Date: Fri, 19 Jun 2026 09:28:46 +0700 Subject: [PATCH] feat: support array auth in RedisConfig for Redis ACL (username + password) --- src/core/Database/RedisConfig.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/Database/RedisConfig.php b/src/core/Database/RedisConfig.php index a6049e46..90908786 100644 --- a/src/core/Database/RedisConfig.php +++ b/src/core/Database/RedisConfig.php @@ -25,7 +25,8 @@ class RedisConfig protected float $read_timeout = 0.0; - protected string $auth = ''; + /** @var string|string[] */ + protected string|array $auth = ''; protected int $dbIndex = 0; @@ -100,12 +101,18 @@ public function withReadTimeout(float $read_timeout): self return $this; } - public function getAuth(): string + /** + * @return string|string[] + */ + public function getAuth(): string|array { return $this->auth; } - public function withAuth(string $auth): self + /** + * @param string|string[] $auth string for password only, array for [username, password] + */ + public function withAuth(string|array $auth): self { $this->auth = $auth; return $this;