Comparison

plugins/mod_register_limits.lua @ 12977:74b9e05af71e

plugins: Prefix module imports with prosody namespace
author Kim Alvefur <zash@zash.se>
date Fri, 24 Mar 2023 13:15:28 +0100
parent 11807:f5295e59ca78
child 13209:c8d949cf6b09
comparison
equal deleted inserted replaced
12976:a187600ec7d6 12977:74b9e05af71e
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 9
10 local create_throttle = require "util.throttle".create; 10 local create_throttle = require "prosody.util.throttle".create;
11 local new_cache = require "util.cache".new; 11 local new_cache = require "prosody.util.cache".new;
12 local ip_util = require "util.ip"; 12 local ip_util = require "prosody.util.ip";
13 local new_ip = ip_util.new_ip; 13 local new_ip = ip_util.new_ip;
14 local match_ip = ip_util.match; 14 local match_ip = ip_util.match;
15 local parse_cidr = ip_util.parse_cidr; 15 local parse_cidr = ip_util.parse_cidr;
16 local errors = require "util.error"; 16 local errors = require "prosody.util.error";
17 17
18 -- COMPAT drop old option names 18 -- COMPAT drop old option names
19 local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations"); 19 local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations");
20 local allowlist_only = module:get_option_boolean("allowlist_registration_only", module:get_option_boolean("whitelist_registration_only")); 20 local allowlist_only = module:get_option_boolean("allowlist_registration_only", module:get_option_boolean("whitelist_registration_only"));
21 local allowlisted_ips = module:get_option_set("registration_allowlist", module:get_option("registration_whitelist", { "127.0.0.1", "::1" }))._items; 21 local allowlisted_ips = module:get_option_set("registration_allowlist", module:get_option("registration_whitelist", { "127.0.0.1", "::1" }))._items;