-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Interface for Modules to Register a Custom Auth Module Callback #179
Comments
I will be working on this issue. Please assign it to me. Here is the detailed approach to support custom authentication callbacks in modules. Please check and suggest if something needs to be added/changed. We intend to create a macro called
The
Integrating the auth callback registration with the existing
To allow both blocking and non-blocking authentication in callbacks, we will provide a
We will also provide The APIs
Example for end user
|
Create Interface for Modules to Register a Custom Auth Module Callback.
In Valkey (even on 7.2), we have the ability to register custom authentication callbacks from Modules using the
ValkeyModule_RegisterAuthCallback
Module API.https://valkey.io/topics/modules-api-ref/#ValkeyModule_RegisterAuthCallback
For Rust Modules, we can abstract away a lot of interactions by implementing a macro that allows both blocking and non blocking authentication implementations in the module.
High level valkeymodule-rs Interface updates:
valkey_module_auth!
) to allow registering authentication callbacks. This macro should also be embedded inside thevalkey_module!
macro such that it can be optionally used by Valkey Rust Modules.valkey_module_auth!
should accept both a callback argument (the function signature should besafe
for Rust Modules to implement, ie - nounsafe
operations) and should allow modules to implement both blocking and non blocking callbacks.BlockedClient
interface inblocked.rs
to allow a new mode of blocking clients - block on authentication by using theValkeyModule_BlockClientOnAuth
BlockedClient
interface inblocked.rs
to allow setting and getting private info. This would be used in blocking authentication to store the result of the authentication and use it when the client is unblocked.See the C Module example of this here: https://github.com/valkey-io/valkey/blob/unstable/tests/modules/auth.c#L83-#L221
The text was updated successfully, but these errors were encountered: