Files
2026-07-13 12:32:21 +08:00

18 lines
345 B
Lua

-- a plugin fixture to force one authentication failure
local FailOnceAuth = {
VERSION = "0.1-t",
PRIORITY = 1000,
}
local failed = {}
function FailOnceAuth:access(conf)
if not failed[conf.service_id] then
failed[conf.service_id] = true
return kong.response.exit(401, { message = conf.message })
end
end
return FailOnceAuth