Describe the feature
There are currently no integration tests that verify connecting to a password-protected server at connection time using ServerCredentials. The existing UpdateConnectionPasswordTests only test the dynamic password update flow (connecting without a password first, then setting/clearing one). This leaves the initial AUTH handshake during connection establishment untested.
The ServerCredentials class has two password-based constructors:
ServerCredentials(string password) — password only (authenticates as default user)
ServerCredentials(string? username, string password) — username + password (authenticates as a specific ACL user)
Neither is exercised in any integration test.
Use Case
Password-based authentication is the most common authentication mode for Valkey/Redis. Without tests covering initial connection auth, regressions in the AUTH handshake (or credential passing to glide-core) could go undetected.
Proposed Solution
Add a new integration test class (e.g., PasswordAuthTests) with the following test cases, each parameterized for both standalone and cluster modes:
- Connect with correct password — succeeds
- Connect with wrong password — fails with expected exception
- Connect without credentials when server requires a password — fails with expected exception
- Connect with correct username + password — succeeds
- Connect with correct username + wrong password — fails with expected exception
- Connect with wrong username + correct password — fails with expected exception
Acknowledgements
Related
tests/Valkey.Glide.IntegrationTests/UpdateConnectionPasswordTests.cs — related but only covers dynamic password updates
tests/Valkey.Glide.IntegrationTests/IamAuthTests.cs — tests IAM auth path, not password auth
sources/Valkey.Glide/ServerCredentials.cs — the class under test
Additional Information
- The test server utilities (
ServerFixture, Server) already support SetPasswordAsync / ClearPasswordAsync, which can be used to configure the server before connecting.
- ACL user tests will need to create/remove ACL users on the server (e.g., via
ACL SETUSER / ACL DELUSER).
- Tests that mutate server auth state should disable parallel execution to avoid interfering with other tests.
Describe the feature
There are currently no integration tests that verify connecting to a password-protected server at connection time using
ServerCredentials. The existingUpdateConnectionPasswordTestsonly test the dynamic password update flow (connecting without a password first, then setting/clearing one). This leaves the initialAUTHhandshake during connection establishment untested.The
ServerCredentialsclass has two password-based constructors:ServerCredentials(string password)— password only (authenticates as default user)ServerCredentials(string? username, string password)— username + password (authenticates as a specific ACL user)Neither is exercised in any integration test.
Use Case
Password-based authentication is the most common authentication mode for Valkey/Redis. Without tests covering initial connection auth, regressions in the
AUTHhandshake (or credential passing to glide-core) could go undetected.Proposed Solution
Add a new integration test class (e.g.,
PasswordAuthTests) with the following test cases, each parameterized for both standalone and cluster modes:Acknowledgements
Related
tests/Valkey.Glide.IntegrationTests/UpdateConnectionPasswordTests.cs— related but only covers dynamic password updatestests/Valkey.Glide.IntegrationTests/IamAuthTests.cs— tests IAM auth path, not password authsources/Valkey.Glide/ServerCredentials.cs— the class under testAdditional Information
ServerFixture,Server) already supportSetPasswordAsync/ClearPasswordAsync, which can be used to configure the server before connecting.ACL SETUSER/ACL DELUSER).