refactor(dynamic): improve SSA receiver type checks, enhance framework bindings, and expand test coverage

This commit is contained in:
elipeter 2026-05-24 14:06:54 -05:00
parent f7310b20ba
commit 3027c1afa7
9 changed files with 583 additions and 56 deletions

View file

@ -1,5 +1,6 @@
// Phase 21 — `ws` WebSocket benign control.
const _NYX_ADAPTER_MARKER = "require('ws')";
const _NYX_WS_MESSAGE_MARKER = "wss.on('connection', ws => ws.on('message', onMessage))";
function onMessage(data) {
return 'echoed: ' + JSON.stringify(String(data));

View file

@ -4,6 +4,7 @@
// WebSocketServer instance. It splices the message bytes into a
// child-process command — classic WS → cmdi shape.
const _NYX_ADAPTER_MARKER = "require('ws')";
const _NYX_WS_MESSAGE_MARKER = "wss.on('connection', ws => ws.on('message', onMessage))";
const { execSync } = require('child_process');

View file

@ -343,6 +343,14 @@ def handler(envelope):\n validate_request(envelope)\n",
"handler",
&["validateMessage"],
),
(
Lang::JavaScript,
b"const { Consumer } = require('sqs-consumer');\n\
function handler(env) {}\n\
Consumer.create({ queueUrl: 'http://localhost/q', visibilityTimeout: 30, handleMessage: handler });\n",
"handler",
&["visibilityTimeout"],
),
(
Lang::Python,
b"from google.cloud import pubsub_v1\n\
@ -379,6 +387,19 @@ def on_message(ch, method, properties, body):\n validate_request(body)\n",
"onMessage",
&["ValidatingMessageConverter"],
),
(
Lang::Java,
b"import org.springframework.amqp.rabbit.annotation.RabbitListener;\n\
public class Vuln {\n\
@RabbitListener(queues = \"work\")\n\
public void onMessage(String body) {}\n\
public void configure(Factory factory) {\n\
factory.setCommonErrorHandler(new DefaultErrorHandler());\n\
}\n\
}\n",
"onMessage",
&["DefaultErrorHandler"],
),
(
Lang::Go,
b"package entry\n\
@ -386,7 +407,7 @@ def on_message(ch, method, properties, body):\n validate_request(body)\n",
func OnMessage(msg *nats.Msg) { ValidatePayload(msg.Data) }\n\
func init() { nc.QueueSubscribe(\"events\", \"workers\", OnMessage) }\n",
"OnMessage",
&["ValidatePayload"],
&["ValidatePayload", "QueueSubscribe"],
),
];