RedisLabsModules / redismodule-rs

Rust API for Redis Modules API
BSD 3-Clause "New" or "Revised" License
265 stars 62 forks source link

Add capability to create module users #354

Open ThatsMrTalbot opened 1 year ago

ThatsMrTalbot commented 1 year ago

This PR adds a new RedisUser type that wraps the native "RedisModuleUser" type as well as functions to set the ACL on that user.

It also adds methods to the context to authenticate a client using the created RedisUser. This is the foundation for building Redis modules that can do user management (I also would like to implement a solution that wraps RedisModule_RegisterAuthCallback when that is released).

I updated the acl example and tests with the new functionality.

Note: This is my first real play with Rust so any feedback is appreciated.