aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-11 20:05:25 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-11 20:05:25 +0000
commitf3a6e16277b4580a03af56476b66df379818bec6 (patch)
tree7407e0d2e6ac366978faf48c1d123421dcf5c1a0 /lualib/lua_selectors.lua
parent721a1c87c8a39d324a319d50f509cdf048783023 (diff)
downloadrspamd-f3a6e16277b4580a03af56476b66df379818bec6.tar.gz
rspamd-f3a6e16277b4580a03af56476b66df379818bec6.zip
[Minor] Selectors: Add equal processor
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r--lualib/lua_selectors.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua
index cc137bddd..8d68341b4 100644
--- a/lualib/lua_selectors.lua
+++ b/lualib/lua_selectors.lua
@@ -497,6 +497,22 @@ the second argument is optional hash type (`blake2`, `sha256`, `sha1`, `sha512`,
['description'] = 'Drops input value and return values from function\'s arguments or an empty string',
['args_schema'] = (ts.string + ts.array_of(ts.string)):is_optional()
},
+ ['equal'] = {
+ ['types'] = {
+ ['string'] = true,
+ },
+ ['map_type'] = 'string',
+ ['process'] = function(inp, _, args)
+ if inp == args[1] then
+ return inp,'string'
+ end
+
+ return nil
+ end,
+ ['description'] = [[Boolean function equal.
+Returns either nil or its argument if input is equal to argument]],
+ ['args_schema'] = {ts.string}
+ },
-- Boolean function in, returns either nil or its input if input is in args list
['in'] = {
['types'] = {