for dom,res in pairs(requests) do
-- tld + "." + check_result, e.g. example.com.+ - reputation for valid sigs
local query = string.format('%s.%s', dom, res)
- rule.backend.set_token(task, rule, nil, query, sc, 'string')
+ rule.backend.set_token(task, rule, nil, query, sc)
end
end
end
if sc then
for _,tld in ipairs(requests) do
- rule.backend.set_token(task, rule, nil, tld[1], sc, 'string')
+ rule.backend.set_token(task, rule, nil, tld[1], sc)
end
end
end
local sc = extract_task_score(task, rule)
if sc then
if asn then
- rule.backend.set_token(task, rule, cfg.asn_prefix, asn, sc, 'string')
+ rule.backend.set_token(task, rule, cfg.asn_prefix, asn, sc, nil, 'string')
end
if country then
- rule.backend.set_token(task, rule, cfg.country_prefix, country, sc, 'string')
+ rule.backend.set_token(task, rule, cfg.country_prefix, country, sc, nil, 'string')
end
- rule.backend.set_token(task, rule, cfg.ip_prefix, ip, sc, 'ip')
+ rule.backend.set_token(task, rule, cfg.ip_prefix, ip, sc, nil, 'ip')
end
end
lua_util.debugm(N, task, 'set spf record %s -> %s = %s',
spf_record, hkey, sc)
- rule.backend.set_token(task, rule, nil, hkey, sc, 'string')
+ rule.backend.set_token(task, rule, nil, hkey, sc)
end
fun.each(function(e)
lua_util.debugm(N, task, 'set generic selector (%s) %s = %s',
rule['symbol'], e, sc)
- rule.backend.set_token(task, rule, nil, e, sc, 'string')
+ rule.backend.set_token(task, rule, nil, e, sc)
end, selector_res)
else
lua_util.debugm(N, task, 'set generic selector (%s) %s = %s',
rule['symbol'], selector_res, sc)
- rule.backend.set_token(task, rule, nil, selector_res, sc, 'string')
+ rule.backend.set_token(task, rule, nil, selector_res, sc)
end
end
end
if prefix then
token = prefix .. token
end
- local res = prefix
+ local res = token
if rule.backend.config.hashed then
local hash_alg = rule.backend.config.hash_alg or "blake2"
local encoding = "base32"
end
local function reputation_redis_get_token(task, rule, prefix, token, continuation_cb, token_type)
- if token_type == 'ip' then
+ if token_type and token_type == 'ip' then
token = tostring(token)
end
local key = gen_token_key(prefix, token, rule)
end
local function reputation_redis_set_token(task, rule, prefix, token, sc, continuation_cb, token_type)
- if token_type == 'ip' then
+ if token_type and token_type == 'ip' then
token = tostring(token)
end
local key = gen_token_key(prefix, token, rule)