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

Function RM_DeauthenticateAndCloseClient

src/module.cpp:6798–6806  ·  view source on GitHub ↗

Deauthenticate and close the client. The client resources will not be * be immediately freed, but will be cleaned up in a background job. This is * the recommended way to deauthenicate a client since most clients can't * handle users becoming deauthenticated. Returns REDISMODULE_ERR when the * client doesn't exist and REDISMODULE_OK when the operation was successful. * * The client ID is

Source from the content-addressed store, hash-verified

6796 * This function is not thread safe, and must be executed within the context
6797 * of a command or thread safe context. */
6798int RM_DeauthenticateAndCloseClient(RedisModuleCtx *ctx, uint64_t client_id) {
6799 UNUSED(ctx);
6800 client *c = lookupClientByID(client_id);
6801 if (c == NULL) return REDISMODULE_ERR;
6802
6803 /* Revoke also marks client to be closed ASAP */
6804 revokeClientAuthentication(c);
6805 return REDISMODULE_OK;
6806}
6807
6808/* Return the X.509 client-side certificate used by the client to authenticate
6809 * this connection.

Callers

nothing calls this directly

Calls 2

lookupClientByIDFunction · 0.85

Tested by

no test coverage detected