Skip to main content

register_authz_hook

Macro register_authz_hook 

Source
macro_rules! register_authz_hook {
    ($factory:expr) => { ... };
}
Expand description

Register an extension authz hook factory at static-init time.

The factory receives a borrowed AuthzHookContext (pool + audit sink) and returns the constructed hook. Wire alongside register_extension! in the extension’s extension.rs:

systemprompt_security::register_authz_hook!(|ctx| {
    std::sync::Arc::new(MyHook::new(ctx.pool.clone(), ctx.sink.clone()))
        as systemprompt_security::authz::SharedAuthzHook
});