• Shaya Potter's avatar
    Add RM_SetContextUser to support acl validation in RM_Call (and scripts) (#10966) · b8fcd322
    Shaya Potter authored
    Adds a number of user management/ACL validaiton/command execution functions to improve a
    Redis module's ability to enforce ACLs correctly and easily.
    
    * RM_SetContextUser - sets a RedisModuleUser on the context, which RM_Call will use to both
      validate ACLs (if requested and set) as well as assign to the client so that scripts executed via
      RM_Call will have proper ACL validation.
    * RM_SetModuleUserACLString - Enables one to pass an entire ACL string, not just a single OP
      and have it applied to the user
    * RM_GetModuleUserACLString - returns a stringified version of the user's ACL (same format as dump
      and list).  Contains an optimization to cache the stringified version until the underlying ACL is modified.
    * Slightly re-purpose the "C" flag to RM_Call from just being about ACL check before calling the
      command, to actually running the command with the right user, so that it also affects commands
      inside EVAL scripts....
    b8fcd322
redismodule.h 90.1 KB