Macro valkey_module_auth

Source
macro_rules! valkey_module_auth {
    ($module_name:expr, $ctx:expr, $($auth_callback:expr),* $(,)*) => { ... };
}
Expand description

Registers authentication callbacks with the Valkey module

Provides an unique safe wrapper for Valkey’s authentication callback registration system. Used within the valkey_module! macro’s auth field.

§Example

use valkey_module::valkey_module;

valkey_module! {
    name: "mymodule",
    version: 1,
    allocator: (ValkeyAlloc, ValkeyAlloc),
    auth: [
        blocking_callback,    // Called 2nd (LIFO)
        simple_callback,     // Called 1st
    ],
    // ... other fields
}

§Note

Callbacks are registered in LIFO order (last callback is called first). Requires Redis 7.2+ or Valkey 7.2+.