Skip to content

feat: Support Redis ACL username in the Go feature server's Redis online store - #7130

Merged
ntkathole merged 3 commits into
feast-dev:masterfrom
gavishtea:feat/go-redis-acl-username
Nov 13, 2026
Merged

ntkathole merged 3 commits into
feast-dev:masterfrom
gavishtea:feat/go-redis-acl-username

Conversation

@gavishtea

Copy link
Copy Markdown
Contributor

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. NewRedisOnlineStore accepts only password, ssl and db in connection_string, and any other key fails with unrecognized option in connection_string. It also never sets Username on redis.Options or redis.ClusterOptions, so go-redis always sends AUTH <password> and logs in as the default user.

Redis 6+ ACL deployments often disable default and 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_string passes username through to redis-py, and the GLIDE client maps it to ServerCredentials. So host:6379,username=feast,password=...,ssl=true works in Python and fails in Go.

connection_string now accepts username=<name>, and it is set on the client for both redis and redis_cluster. go-redis then sends HELLO <protocol> AUTH <username> <password>, falling back to AUTH <username> <password>. Connection strings without username behave as before. Unknown keys still fail, and the error now lists all supported options ('password', 'username', 'ssl', 'db'). Before, the message left out db.

Against a local Redis 7 with ACL SETUSER feast on >secret ~* +@all and ACL SETUSER default off:

Before:
  localhost:6379,username=feast,password=secret -> unrecognized option in connection_string: username. Must be one of 'password', 'ssl'
  localhost:6379,password=secret                -> ERR AUTH <password> called without any password configured for the default user
After:
  localhost:6379,username=feast,password=secret -> PONG

The Redis online store docs get an ACL user example and a note on which connection_string options the Go feature server accepts.

Which issue(s) this PR fixes:

None (no existing issue).

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Misc

redisonlinestore_test.go adds tests for username with a single node, with password listed first, with redis_cluster and 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, and go test ./internal/feast/onlinestore/ passes except TestSqliteOnlineRead, which also fails on master (interface conversion: arrow.Array is *array.Int64, not *array.Int32) and is unrelated.

@gavishtea
gavishtea requested a review from a team as a code owner November 10, 2026 23:45
@codecov-commenter

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.32%. Comparing base (e81e69d) to head (225b00a).
⚠️ Report is 2 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
go-feature-server 30.96% <100.00%> (+0.37%) ⬆️
python-unit 53.82% <ø> (-0.01%) ⬇️
Files with missing lines Coverage Δ
go/internal/feast/onlinestore/redisonlinestore.go 49.50% <100.00%> (+6.93%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e81e69d...225b00a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 username in 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

Comment on lines +90 to +91
} else if kv[0] == "username" {
username = kv[1]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@ntkathole
ntkathole force-pushed the feat/go-redis-acl-username branch from 225b00a to 72791c0 Compare November 13, 2026 06:57
@ntkathole
ntkathole merged commit 021e9af into feast-dev:master Nov 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants