-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis driver fork update v9.6.1 #47049
Conversation
458c630
to
8bdc468
Compare
8bdc468
to
576b62a
Compare
OnConnect: onConnect, | ||
|
||
// Auth should be done by the `OnConnect` callback here. So disable | ||
// "automatic" auth by the client. | ||
DisableAuthOnConnect: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the previous driver, we disabled auth on connect and performed auth during OnConnect
callback.
We are switching to use CredentialsProviderContext
now for auth and we set Protocol
to v2 so the driver won't do RESP3 HELLO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at drive code it will always send HELLO 2 now instead of not doing HELLO at all (on connection), right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and the auth will be done using HELLO 2 AUTH <user> <password>
instead of just AUTH. In my opinion, it's a win for newer servers. I haven't tested older version (<6.2) tho. The driver suppose to fallback to regular AUTH. We can test that during release testing.
func authWithPasswordOnConnect(username, password string) onClientConnectFunc { | ||
return func(ctx context.Context, conn *redis.Conn) error { | ||
return authConnection(ctx, conn, username, password) | ||
func authWithPasswordOnConnect(username, password string) fetchCredentialsFunc { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple refactor to change the onConnect functions to credentials provider.
// but Teleport currently only supports RESP2. The client generally | ||
// fallbacks to RESP2 when they receive an unknown command error for the | ||
// HELLO message. | ||
e.maybeHandleFirstHello() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is caught and verified by TestAccessRedis
test (which is basically a bug in our code that we haven't caught before with "older" clients)
OnConnect: onConnect, | ||
|
||
// Auth should be done by the `OnConnect` callback here. So disable | ||
// "automatic" auth by the client. | ||
DisableAuthOnConnect: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at drive code it will always send HELLO 2 now instead of not doing HELLO at all (on connection), right?
Friendly ping @r0mant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bot.
…/redis_driver_update
* Redis driver fork update * fix lint * update integrations * fix typo
Part of #43544
Fork branch: https://github.com/gravitational/redis/tree/teleport/v9.6.1
Fork release: https://github.com/gravitational/redis/releases/tag/v9.6.1-teleport.1