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.
@mesg/application
Advanced tools
[Website](https://mesg.com/) - [Docs](https://docs.mesg.com/) - [Forum](https://forum.mesg.com/) - [Chat](https://discordapp.com/invite/SaZ5HcE) - [Blog](https://blog.mesg.com)
Website - Docs - Forum - Chat - Blog
This library lets you connect to the MESG engine to listen for any event or result that you might be interested too. It also allows you to execute a task, either synchronously or asynchronously.
npm install @mesg/application
Require mesg-js as an application:
const Application = require('@mesg/application')
const mesg = new Application()
By default, the library connects to the MESG Engine from the endpoint localhost:50052
.
Instead of hard-coding runnerHash
in your application's env, your application can resolve dynamically using the service's SID.
const runnerHash = await mesg.resolveRunner('SID_OF_THE_SERVICE')
const result = await mesg.executeTaskAndWaitResult({
executorHash: runnerHash,
.....
})
Listen events from a service.
const instanceHash = await mesg.resolve('SID_OF_THE_SERVICE')
mesg.listenEvent({
filter: {
instanceHash: instanceHash,
key: 'EVENT_KEY' // optional
}
})
.on('data', (event) => {
console.log('an event received:', event.key, mesg.decodeData(event.data))
})
Listen results from a service.
const runnerHash = await mesg.resolveRunner('SID_OF_THE_SERVICE')
mesg.listenResult({
filter: {
executorHash: runnerHash,
taskKey: 'TASK_KEY_FILTER', // optional
tags: ['TAG_FILTER'] // optional
}
})
.on('data', (result) => {
if (result.error) {
console.error('an error has occurred:', result.error)
return
}
console.log('a result received:', mesg.decodeData(result.outputs))
})
Execute task on a service.
const runnerHash = await mesg.resolveRunner('SID_OF_THE_SERVICE')
const execution = await mesg.executeTask({
executorHash: runnerHash,
eventHash: event.hash,
taskKey: 'TASK_KEY',
inputs: mesg.encodeData({ key: 'INPUT_DATA' }),
tags: ['ASSOCIATE_TAG'] // optional
})
console.log('task in progress with execution:', execution.hash)
Execute task on a service and wait for its result.
This can be considered as a shortcut for using both executeTask()
and listenResult()
at same time.
const runnerHash = await mesg.resolveRunner('SID_OF_THE_SERVICE')
const result = await mesg.executeTaskAndWaitResult({
executorHash: runnerHash,
eventHash: event.hash,
taskKey: 'TASK_KEY',
inputs: mesg.encodeData({ key: 'INPUT_DATA' }),
tags: ['ASSOCIATE_TAG'] // optional
})
if (result.error) {
console.error('an error has occurred:', result.error)
throw new Error(result.error)
}
console.log('a result received:', mesg.decodeData(result.outputs))
FAQs
[Website](https://mesg.com/) - [Docs](https://docs.mesg.com/) - [Forum](https://forum.mesg.com/) - [Chat](https://discordapp.com/invite/SaZ5HcE) - [Blog](https://blog.mesg.com)
We found that @mesg/application demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.