You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raised this issue against the redis project (redis/redis#13330), but I've re-created it with valkey as well.
I'm developing an authentication module that takes advantage of the authentication module features to block the client during authentication.
When the server is configured for cluster mode and the cluster is down, such as when it is first being created, any client that attempts to login gets the message "AUTH failed: CLUSTERDOWN The cluster is down". My code is authenticating the user with RedisModule_AuthenticateClientWithACLUser and returning REDISMODULE_AUTH_HANDLED in the same way that the test code under test/modules/auth.c is doing.
To reproduce
Attached is the minimal code from tests/modules/auth.c to create a module to expose the problem. auth.c.gz
valkey.conf file:
loadmodule auth.so
cluster-enabled yes
cluster-config-file cluster.nodes.conf
user foo on ~* +@all
user default off
Steps to re-create:
Compile the module with gcc -shared auth.c -o auth.so
Start redis the attached config file
login with the user foo, password blocking.
$ valkey-cli --user foo --pass blocking
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: CLUSTERDOWN The cluster is down
Expected behavior
A client blocked for auth module authentication should be able to login even if the cluster is down.
Additional information
In the 7.2 code, I believe the fix is to exclude clients that are blocked for module authentication in:
Describe the bug
I raised this issue against the redis project (redis/redis#13330), but I've re-created it with valkey as well.
I'm developing an authentication module that takes advantage of the authentication module features to block the client during authentication.
When the server is configured for cluster mode and the cluster is down, such as when it is first being created, any client that attempts to login gets the message "AUTH failed: CLUSTERDOWN The cluster is down". My code is authenticating the user with RedisModule_AuthenticateClientWithACLUser and returning REDISMODULE_AUTH_HANDLED in the same way that the test code under test/modules/auth.c is doing.
To reproduce
Attached is the minimal code from tests/modules/auth.c to create a module to expose the problem.
auth.c.gz
valkey.conf file:
Steps to re-create:
gcc -shared auth.c -o auth.so
foo
, passwordblocking
.Expected behavior
A client blocked for auth module authentication should be able to login even if the cluster is down.
Additional information
In the 7.2 code, I believe the fix is to exclude clients that are blocked for module authentication in:
cluster.c -> clusterRedirectBlockedClientIfNeeded
int clusterRedirectBlockedClientIfNeeded(client *c) {
if (c->flags & CLIENT_BLOCKED &&
(c->bstate.btype == BLOCKED_LIST ||
c->bstate.btype == BLOCKED_ZSET ||
c->bstate.btype == BLOCKED_STREAM ||
c->bstate.btype == BLOCKED_MODULE)
&& !clientHasModuleAuthInProgress(c))
{
...
The text was updated successfully, but these errors were encountered: