diff --git a/docs/docs/admin/policies.mdx b/docs/docs/admin/policies.mdx index bc193d6d..2065f49b 100644 --- a/docs/docs/admin/policies.mdx +++ b/docs/docs/admin/policies.mdx @@ -326,7 +326,7 @@ If you are using [Redis™ Sentinel](https://redis.io/docs/latest/operate/oss_an | `clientName` | string | `Anubis` | The client name reported to Redis™ Sentinel. Set this if you want to track Anubis connections to your Redis™ Sentinel. | | `masterName` | string | `mymaster` | (Required) The name of the master in the Redis™ Sentinel configuration. This is used to discover where to find client connection hosts/ports. | | `username` | string | `azurediamond` | The username used to authenticate against the Redis™ Sentinel and Redis™ servers. | -| `password` | string | `hunter2` | (Required) The password used to authenticate against the Redis™ Sentinel and Redis™ servers. | +| `password` | string | `hunter2` | The password used to authenticate against the Redis™ Sentinel and Redis™ servers. | ## Risk calculation for downstream services diff --git a/lib/store/valkey/factory.go b/lib/store/valkey/factory.go index 99791863..309bf656 100644 --- a/lib/store/valkey/factory.go +++ b/lib/store/valkey/factory.go @@ -24,7 +24,6 @@ var ( // Sentinel validation errors ErrSentinelMasterNameRequired = errors.New("valkey.Sentinel: masterName is required") ErrSentinelAddrRequired = errors.New("valkey.Sentinel: addr is required") - ErrSentinelPasswordRequired = errors.New("valkey.Sentinel: password is required") ErrSentinelAddrEmpty = errors.New("valkey.Sentinel: addr cannot be empty") ) @@ -68,7 +67,7 @@ type Sentinel struct { Addr internal.ListOr[string] `json:"addr"` ClientName string `json:"clientName,omitempty"` Username string `json:"username,omitempty"` - Password string `json:"password"` + Password string `json:"password,omitempty"` } func (s Sentinel) Valid() error { @@ -94,10 +93,6 @@ func (s Sentinel) Valid() error { } } - if s.Password == "" { - errs = append(errs, ErrSentinelPasswordRequired) - } - if len(errs) > 0 { return errors.Join(errs...) } diff --git a/lib/store/valkey/valkey_test.go b/lib/store/valkey/valkey_test.go index 5b952702..a509e1c6 100644 --- a/lib/store/valkey/valkey_test.go +++ b/lib/store/valkey/valkey_test.go @@ -91,7 +91,7 @@ func TestFactoryValid(t *testing.T) { { name: "sentinel missing password", jsonData: `{"sentinel": {"masterName": "mymaster", "addr": ["localhost:26379"]}}`, - expectError: ErrSentinelPasswordRequired, + expectError: nil, }, { name: "sentinel with optional fields",