diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-09 11:53:01 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-11-09 11:53:01 +0000 |
commit | fa767d0c1b5fae0ebbd1c096cb15021383ee5eff (patch) | |
tree | 4d4fe935980922077f4cc2226b4b0aac30a782da /lualib/lua_maps_expressions.lua | |
parent | 2c89d492083cbb95a290b41510a743a4f37065fb (diff) | |
download | rspamd-fa767d0c1b5fae0ebbd1c096cb15021383ee5eff.tar.gz rspamd-fa767d0c1b5fae0ebbd1c096cb15021383ee5eff.zip |
[Minor] Add maps expressions schema
Diffstat (limited to 'lualib/lua_maps_expressions.lua')
-rw-r--r-- | lualib/lua_maps_expressions.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lualib/lua_maps_expressions.lua b/lualib/lua_maps_expressions.lua index 9535f809d..be4368bd3 100644 --- a/lualib/lua_maps_expressions.lua +++ b/lualib/lua_maps_expressions.lua @@ -39,6 +39,7 @@ local lua_maps = require "lua_maps" local rspamd_expression = require "rspamd_expression" local rspamd_logger = require "rspamd_logger" local fun = require "fun" +local ts = require("tableshape").types local exports = {} @@ -85,6 +86,17 @@ local function process_func(elt, task) return nil end + +exports.schema = ts.shape{ + expression = ts.string, + rules = ts.array_of( + ts.shape{ + selector = ts.string, + map = lua_maps.map_schema, + } + ) +} + --[[[ -- @function lua_maps_expression.create(config, object, module_name) -- Creates a new maps combination from `object` for `module_name`. |