Repository navigation
feat: Support Redis ACL username in the Go feature server's Redis online store - #7130
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7130 +/- ##
==========================================
+ Coverage 52.29% 52.32% +0.02%
==========================================
Files 459 459
Lines 58090 58095 +5
Branches 8560 8560
==========================================
+ Hits 30381 30396 +15
+ Misses 25629 25614 -15
- Partials 2080 2085 +5
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Redis connection parsing misclassifies ACL usernames containing : as addresses, preventing named-user authentication and adding a bogus cluster seed address.
1 open issue
What changed in this PR
Adds named Redis ACL user support to the Go feature server, aligning its Redis authentication options with the Python SDK while preserving password-only behavior.
Changes:
- Accepts
usernamein connection strings and passes it to single-node and cluster clients. - Adds parsing and compatibility tests, and completes the unsupported-option error message.
- Documents ACL configuration and refreshes the secret-scanning baseline.
| File | Description |
|---|---|
go/internal/feast/onlinestore/redisonlinestore.go |
Parses and forwards usernames; updates the supported-option error. |
go/internal/feast/onlinestore/redisonlinestore_test.go |
Covers usernames, option ordering, cluster TLS, and existing defaults. |
docs/reference/online-stores/redis.md |
Adds an ACL example and documents Go-supported options. |
.secrets.baseline |
Updates the existing test-secret location and generation timestamp. |
Review effort: Balanced
| } else if kv[0] == "username" { | ||
| username = kv[1] |
There was a problem hiding this comment.
Good catch. The : address check ran before the = option check, so username=team:feast (or a password containing :) was treated as an address. Fixed in 225b00a by checking for = first, the same order the Python SDK parser uses. Added TestNewRedisOnlineStoreWithColonInOptionValues and TestNewRedisOnlineStoreClusterWithColonInUsername; both fail without the fix and pass with it.
…ine store The Go Redis online store accepted only password, ssl and db in connection_string and never set Username on the go-redis options, so it always authenticated as the default user. Accept username=<name> and set it on both the single-node and cluster clients, matching the Python SDK. List all supported options in the unrecognized-option error. Signed-off-by: gavishtea <10455554+gavishtea@users.noreply.github.com>
Mark the placeholder passwords in the new Redis ACL username tests with pragma: allowlist secret, and refresh the line number of the existing redisonlinestore_test.go entry in .secrets.baseline. Signed-off-by: gavishtea <10455554+gavishtea@users.noreply.github.com>
Options were matched only after the ':' address check, so an option value containing ':' (such as username=team:feast or a password with a colon) was treated as a host:port address. The client then authenticated as the default user, and the cluster client got an extra bogus seed address. Check for '=' first, as the Python SDK parser does. Signed-off-by: gavishtea <10455554+gavishtea@users.noreply.github.com>
225b00a to
72791c0
Compare

What this PR does / why we need it:
The Go feature server's Redis online store can't log in as a named Redis ACL user.
NewRedisOnlineStoreaccepts onlypassword,sslanddbinconnection_string, and any other key fails withunrecognized option in connection_string. It also never setsUsernameonredis.Optionsorredis.ClusterOptions, so go-redis always sendsAUTH <password>and logs in as thedefaultuser.Redis 6+ ACL deployments often disable
defaultand give out named users. AWS ElastiCache RBAC user groups are one example. Those deployments reject the Go feature server. The Python SDK already handles them:RedisOnlineStore._parse_connection_stringpassesusernamethrough to redis-py, and the GLIDE client maps it toServerCredentials. Sohost:6379,username=feast,password=...,ssl=trueworks in Python and fails in Go.connection_stringnow acceptsusername=<name>, and it is set on the client for bothredisandredis_cluster. go-redis then sendsHELLO <protocol> AUTH <username> <password>, falling back toAUTH <username> <password>. Connection strings withoutusernamebehave as before. Unknown keys still fail, and the error now lists all supported options ('password', 'username', 'ssl', 'db'). Before, the message left outdb.Against a local Redis 7 with
ACL SETUSER feast on >secret ~* +@allandACL SETUSER default off:The Redis online store docs get an ACL user example and a note on which
connection_stringoptions the Go feature server accepts.Which issue(s) this PR fixes:
None (no existing issue).
Checks
git commit -s)Testing Strategy
Misc
redisonlinestore_test.goadds tests forusernamewith a single node, withpasswordlisted first, withredis_clusterand TLS, for a value that contains=, and for the unknown-option error. The existing default and password-only tests now also check that the username is empty. The new username and error-message tests fail on master and pass with this change.go vet ./internal/feast/onlinestore/is clean, andgo test ./internal/feast/onlinestore/passes exceptTestSqliteOnlineRead, which also fails on master (interface conversion: arrow.Array is *array.Int64, not *array.Int32) and is unrelated.