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
The feature should expose something similar to plugins.RegisterAction to register custom directives.
Basic example
One should be able to add a custom directive with plugins.RegisterDirective(). There was something similar in v2 according to this plugin but seems missing in v3.
Motivation
This will help in extending the flexibility of creating plugins.
Current Issue:- Right now I am creating a plugin for rate-limit support for Coraza but I have to mention the configuration for rate-limit using an action called rate-limit (part of the plugin) for each rule. Once I have the capability to add directives I can add a directive that saves default rate-limit plugin configuration.
The text was updated successfully, but these errors were encountered:
I have been doing some research, and we have certain limitations:
Directives should only affect operators and actions
We can easily add values from directives into OperatorOptions, but what about actions? They receive RuleMetadata. Should we only implement it for operators?
Where do we store custom data from custom operators? The current implementation of directives has access to sensitive low-level stuff we want to avoid exposing, like rule parsing.
Summary
The feature should expose something similar to plugins.RegisterAction to register custom directives.
Basic example
One should be able to add a custom directive with plugins.RegisterDirective(). There was something similar in v2 according to this plugin but seems missing in v3.
Motivation
This will help in extending the flexibility of creating plugins.
Current Issue:- Right now I am creating a plugin for rate-limit support for Coraza but I have to mention the configuration for rate-limit using an action called rate-limit (part of the plugin) for each rule. Once I have the capability to add directives I can add a directive that saves default rate-limit plugin configuration.
The text was updated successfully, but these errors were encountered: