You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
Have a single new macro (valkey_module_auth!) to allow registering authentication callbacks. This macro should also be embedded inside the valkey_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 be safe for Rust Modules to implement, ie - no unsafe operations) and should allow modules to implement both blocking and non blocking callbacks.
Extend the BlockedClient interface in blocked.rs to allow a new mode of blocking clients - block on authentication by using the ValkeyModule_BlockClientOnAuth
Extend the BlockedClient interface in blocked.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.
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: