Jump to content

Module:Sensitive IP addresses/API

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 10:24, 24 July 2016 (add p.getSensitivityReasons). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- This module provides functions for handling sensitive IP addresses.

local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType

local p = {}

local sensitivityReasons = {
	political = true,
	technical = true,
}

function p.isValidSensitivityReason(s)
	checkType('isValidSensitivityReason', 1, s, 'string')
	return sensitivityReasons[s] ~= nil
end

function p.getSensitivityReasons()
	local ret = {}
	for reason in pairs(sensitivityReasons) do
		ret[#ret + 1] = reason
	end
	table.sort(ret)
	return ret
end

return p