commit fa767d0: [Minor] Add maps expressions schema
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Nov 9 11:56:08 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-11-09 11:53:01 +0000
URL: https://github.com/rspamd/rspamd/commit/fa767d0c1b5fae0ebbd1c096cb15021383ee5eff
[Minor] Add maps expressions schema
---
lualib/lua_maps_expressions.lua | 12 ++++++++++++
1 file changed, 12 insertions(+)
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`.
More information about the Commits
mailing list