Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@aws-smithy/server-node
Advanced tools
Base components for Smithy services running on NodeJS
This package provides glue code to enable using a server sdk with NodeJS.
import { createServer, IncomingMessage, ServerResponse } from "http";
import { HttpRequest } from "@aws-sdk/protocol-http";
import {
GreetingService as __GreetingService,
SayHelloInput,
SayHelloOutput,
getGreetingServiceHandler,
} from "@greeting-service/service-greeting";
import { convertEvent, convertResponse } from "@aws-smithy/server-node";
class GreetingService implements __GreetingService {
SayHello(input: SayHelloInput, request: HttpRequest): SayHelloOutput {
return {
greeting: `Hello ${input.name}! How is ${input.city}?`,
};
}
}
const serviceHandler = getGreetingServiceHandler(new GreetingService());
const server = createServer(async function (
req: IncomingMessage,
res: ServerResponse<IncomingMessage> & { req: IncomingMessage }
) {
// Convert NodeJS's http request to an HttpRequest.
const httpRequest = convertRequest(req);
// Call the service handler, which will route the request to the GreetingService
// implementation and then serialize the response to an HttpResponse.
const httpResponse = await serviceHandler.handle(httpRequest);
// Write the HttpResponse to NodeJS http's response expected format.
return writeResponse(httpResponse, res);
});
server.listen(3000);
console.error("Listening on port 3000");
FAQs
Base components for Smithy services running on NodeJS
We found that @aws-smithy/server-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.