eris: move lua API to standalone module

Easier to work with now, yay.
This commit is contained in:
raf 2025-05-02 05:45:14 +03:00
commit 54f858aee9
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 297 additions and 127 deletions

View file

@ -0,0 +1,17 @@
function generate_honeytoken(token)
local token_types = { "API_KEY", "AUTH_TOKEN", "SESSION_ID", "SECRET_KEY" }
local prefix = token_types[math.random(#token_types)]
local suffix = string.format("%08x", math.random(0xffffff))
return prefix .. "_" .. token .. "_" .. suffix
end
function enhance_response(text, response_type, path, token)
local result = text
local honeytoken = generate_honeytoken(token)
-- Add some fake sensitive data
result = result .. "\n<!-- DEBUG: " .. honeytoken .. " -->"
result = result .. "\n<div style='display:none'>Server ID: " .. token .. "</div>"
return result
end