Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@epsor/consumer-wrapper
Advanced tools
@epsor/consumer-wrapper
It wrap the consumer connection to kafka, redis connexion, mongodb connexion to help you to develop new consumer faster.
@epsor/consumer-wrapper
assumes that a few environment variables are set:
EVENT_TOPIC
- The event topic to consumeMONGODB_URL
- The mongoDB server urlREDIS_URL
- The redis server urlKAFKA_HOST
- The kafka server info IP:PORTKAFKA_GROUP_ID
- The kafka group idThis package comes with AbstractHandler
which is supposed to be extanded by your consumers handler.
Here an example of a handler:
import { MongoDuplicateEntryError } from '@epsor/mongodb-wrapper';
class UserCreateHandler extends AbstractHandler {
/** @inheritdoc */
static get handlerName() {
return 'UserCreate';
}
/** @inheritdoc */
static get allowedTypes() {
return ['user.created'];
}
/** @inheritdoc */
static async handle({ mongo }, userCreatedDto) {
const users = await mongo.collection('users');
try {
await users.insertOne(userCreatedDto.fields);
} catch (err) {
if (err instanceof MongoDuplicateEntryError) {
// An error occurred
}
}
}
}
import { Consumer } from '@epsor/consumer-wrapper';
/** @type {AbstractHandler[]} */
import handlers from './handlers';
(async () => {
const consumer = new Consumer('b2c', handlers);
await consumer.initDependencies();
await consumer.createCollections('users');
await consumer.run();
})();
This package contains an express api endpoint to check pod's health.
npm start
to start the server.http://localhost:{HEALTHCHECK_PORT}/.well-known/express/server-health
. Default port is 8000
please look at the README.md of epsor-v2 to get the list of supported ports for every consumers.
FAQs
Event consumer
We found that @epsor/consumer-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 26 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.