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.
argosy-service
Advanced tools
Use argosy instead. This module is no longer maintained as a separate entity.
Easily create micro-services.
Part of the Argosy family.
var service = require('argosy-service')(),
match = require('argosy-pattern/match'),
client = require('argosy-client')
// connect the client to the service
client.pipe(service).pipe(client)
// create the service
service.message({ greet: match.string }).process(function (msg, cb) {
cb(null, 'Hello ' + msg.greet)
})
// use the service
client.invoke({ greet: 'Jason' }, function (err, result) {
console.log(result)
})
or with promises...
// create the service
service.message({ greet: match.string }).process(function (msg) {
return Promise.resolve('Hello ' + msg.greet)
})
// use the service
client.invoke({ greet: 'Jason' }).then(console.log)
var argosyService = require('argosy-service')
Create a new service object. The service
object is a stream intended to be connected (piped) to Argosy clients
through any number of intermediary streams.
Create a concurrent-queue that will be pushed messages that
match the pattern
object provided (see argosy-pattern for details on
defining patterns). These messages should be processed and responded to using the process
function of the queue
.
Responses will be sent to the connected/requesting client.
It is advised not to match the key argosy
as this is reserved for internal use.
All services created will respond to messages that match {argosy: 'info'}
. The response payload will be:
{
role: 'service',
implemented: [
'encoded argosy pattern 1',
'encoded argosy pattern 2',
'...'
]
}
The implemented array will contain encoded argosy-pattern's for which the service will respond.
Incoming requests are structured like so:
{
type: 'request',
headers: { client: { id: 'uuid', seq: 0 } },
body: {}
}
Where:
Outbound responses are structured like so:
{
type: 'response',
headers: { client: { id: 'uuid', seq: 0 } },
body: {},
error: { message: '', stack: '' }
}
Where:
When a new message pattern for the service is defined, a notify-implemented
message object will be emitted from the service
stream. This allows connected listers to be made aware of new message implementations. The structure of this message is:
{
type: 'notify-implemented',
body: 'encoded argosy pattern'
}
npm test [--dot | --spec] [--grep=pattern]
Specifying --dot
or --spec
will change the output from the default TAP style.
Specifying --grep
will only run the test files that match the given pattern.
npm run coverage [--html]
This will output a textual coverage report. Including --html
will also open
an HTML coverage report in the default browser.
FAQs
Easily create micro-services.
We found that argosy-service 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.