MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / moduleFreeAuthenticatedClients

Function moduleFreeAuthenticatedClients

src/module.cpp:6650–6663  ·  view source on GitHub ↗

Cleanup all clients that have been authenticated with this module. This * is called from onUnload() to give the module a chance to cleanup any * resources associated with clients it has authenticated. */

Source from the content-addressed store, hash-verified

6648 * is called from onUnload() to give the module a chance to cleanup any
6649 * resources associated with clients it has authenticated. */
6650static void moduleFreeAuthenticatedClients(RedisModule *module) {
6651 listIter li;
6652 listNode *ln;
6653 listRewind(g_pserver->clients,&li);
6654 while ((ln = listNext(&li)) != NULL) {
6655 client *c = (client*)listNodeValue(ln);
6656 if (!c->auth_module) continue;
6657
6658 RedisModule *auth_module = (RedisModule *) c->auth_module;
6659 if (auth_module == module) {
6660 revokeClientAuthentication(c);
6661 }
6662 }
6663}
6664
6665/* Creates a Redis ACL user that the module can use to authenticate a client.
6666 * After obtaining the user, the module should set what such user can do

Callers 1

moduleUnloadFunction · 0.85

Calls 3

listRewindFunction · 0.85
listNextFunction · 0.85

Tested by

no test coverage detected