Add Lua plugin host, built-in amazon plugin and dibs check.
Sandboxed gopher-lua with time, memory and call-stack limits from [sandbox], a goquery-backed doc API, price parsing, and the 'check', 'plugin test' and 'fixtures' commands. Sellers are first_party, fulfilled (shipped by the shop) or third_party, and items accept fulfilled by default; used-only offers are not available. Plugin tests run on real pages that 'dibs fixtures' fetches into an untracked directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f90ef18f90
commit
bb010356a0
28 files changed
+2096
-26
No files matched your search
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
-- Recurses until the call stack limit is hit.
|
||||
local function deep(n) return deep(n + 1) + 1 end
|
||||
|
||||
return { parse = function()
|
||||
deep(0)
|
||||
|
||||
return { available = true }
|
||||
end }
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
-- Nothing that reads files, loads code or reaches the interpreter's
|
||||
-- internals may be visible to a plugin.
|
||||
local leaked = {}
|
||||
for _, name in ipairs({ "os", "io", "debug", "package", "coroutine", "dofile", "loadfile", "load",
|
||||
"loadstring", "require", "module", "collectgarbage", "getfenv", "setfenv", "newproxy", "_printregs" }) do
|
||||
if _G[name] ~= nil then leaked[#leaked + 1] = name end
|
||||
end
|
||||
|
||||
return { parse = function() return { available = #leaked == 0, title = table.concat(leaked, ",") } end }
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
-- Grows a table until the memory watchdog stops it.
|
||||
return { parse = function()
|
||||
local t = {}
|
||||
for i = 1, 1e8 do t[i] = "value " .. i end
|
||||
|
||||
return { available = true }
|
||||
end }
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
-- string.rep would allocate 10 GB at once, faster than the watchdog reacts.
|
||||
return { parse = function()
|
||||
local s = string.rep("x", 1e10)
|
||||
|
||||
return { available = true }
|
||||
end }
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
-- Loops forever on "loop" and "pcall"; pcall must not be able to swallow the
|
||||
-- timeout. Any other URL returns normally.
|
||||
return { parse = function(doc, url)
|
||||
if url == "loop" then while true do end end
|
||||
if url == "pcall" then while true do pcall(function() while true do end end) end end
|
||||
|
||||
return { available = true }
|
||||
end }
|
||||
Reference in new issue
Block a user