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.
@ingenious-redox/destination-middleware
Advanced tools
A set of expressjs middlewares to ease the development of Redox destinations endpoints
This package is a collection of express middleware functions that helps building Redox destination apps with node and express.
When you set up a Redox destination, this means an endpoint that listens to requests from the Redox engine you need to do the following:
answerChallenge(req, res)
The answerChallenge
middleware will return to Redox engine the challenge sent by in the request with a status of 200
.
const express = require("express");
const { answerChallenge } = require("@ingenious-redox/destination-middleware");
const app = express();
app.get("/", answerChallenge); // Use `app.get` when the challenge is configured with GET for your destination on Redox engine UI
app.listen(process.env.PORT, () =>
console.log(`Example app listening on port ${process.env.PORT}!`)
);
verifyCaller(verificationToken) => (req, res)
const express = require("express");
const { answerChallenge } = require("@ingenious-redox/destination-middleware");
const app = express();
app.use(verifyCaller(process.env.VERIFICATION_TOKEN)); // This verification token should match the one that's configured for your destination on Redox engine UI
app.listen(process.env.PORT, () =>
console.log(`Example app listening on port ${process.env.PORT}!`)
);
The verifyCaller
middleware is configured with the verification token and returns a middleware in charge of validating the correct header.
routeMessages(app, resolverFn) => (req, res)
The routeMessages
lets you handle the different types of Data Models and Event Types in different URLs of your express app. For example, if you want to receive all PatientPush
from the Clinical Summary
you can use routeMessages
and later register the following URL app.post("/ClinicalSummary/PatientPush")
.
routeMessages
receives the express app
and optionally a resolverFn(dataModel, eventType)
. The resolverFn
is in charge of normalizing the data model and event type names, the default implementation removes spaces and redirects to /DataModelName/EventTypeName
.
const express = require("express");
const bodyParser = require("body-parser");
const { routeMessages } = require("@ingenious-redox/destination-middleware");
const app = express();
app.use(bodyParser.json());
app.post("/", routeMessages(app));
app.post("/ClinicalSummary/PatientPush", (req, res) => {
// Do something with req.body
console.log(req.body);
res.sendStatus(201);
});
app.listen(process.env.PORT, () =>
console.log(`Example app listening on port ${process.env.PORT}!`)
);
FAQs
A set of expressjs middlewares to ease the development of Redox destinations endpoints
The npm package @ingenious-redox/destination-middleware receives a total of 0 weekly downloads. As such, @ingenious-redox/destination-middleware popularity was classified as not popular.
We found that @ingenious-redox/destination-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.