MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_DeauthenticateAndCloseClient

Function RM_DeauthenticateAndCloseClient

app/redis-6.2.6/src/module.c:6606–6614  ·  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

6604 * This function is not thread safe, and must be executed within the context
6605 * of a command or thread safe context. */
6606int RM_DeauthenticateAndCloseClient(RedisModuleCtx *ctx, uint64_t client_id) {
6607 UNUSED(ctx);
6608 client *c = lookupClientByID(client_id);
6609 if (c == NULL) return REDISMODULE_ERR;
6610
6611 /* Revoke also marks client to be closed ASAP */
6612 revokeClientAuthentication(c);
6613 return REDISMODULE_OK;
6614}
6615
6616/* Return the X.509 client-side certificate used by the client to authenticate
6617 * this connection.

Callers

nothing calls this directly

Calls 2

lookupClientByIDFunction · 0.85

Tested by

no test coverage detected