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

Function moduleNotifyUserChanged

src/module.cpp:6615–6626  ·  view source on GitHub ↗

This function is called when a client's user has changed and invokes the * client's user changed callback if it was set. This callback should * cleanup any state the module was tracking about this client. * * A client's user can be changed through the AUTH command, module * authentication, and when a client is freed. */

Source from the content-addressed store, hash-verified

6613 * A client's user can be changed through the AUTH command, module
6614 * authentication, and when a client is freed. */
6615void moduleNotifyUserChanged(client *c) {
6616 if (c->auth_callback) {
6617 c->auth_callback(c->id, c->auth_callback_privdata);
6618
6619 /* The callback will fire exactly once, even if the user remains
6620 * the same. It is expected to completely clean up the state
6621 * so all references are cleared here. */
6622 c->auth_callback = NULL;
6623 c->auth_callback_privdata = NULL;
6624 c->auth_module = NULL;
6625 }
6626}
6627
6628void revokeClientAuthentication(client *c) {
6629 /* Freeing the client would result in moduleNotifyUserChanged() to be

Callers 5

freeClientFunction · 0.85
resetCommandFunction · 0.85
ACLAuthenticateUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected