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.
aws-snsclient2
Advanced tools
The main SNSClient
callback now returns the more accepted Node.js method of function(err, msg)
. v0.1 sent both the error and message as a single argument.
$ npm install aws-snsclient
var http = require('http')
, SNSClient = require('aws-snsclient');
var client = SNSClient(function(err, message) {
console.log(message);
});
http.createServer(function(req, res) {
if(req.method === 'POST' && req.url === '/receive') {
return client(req, res);
}
res.writeHead(404);
res.end('Not found.');
}).listen(9000);
Your client only needs to accept one callback, which accepts an object of the decoded message sent from the SNS topic.
message
is the raw JSON. You'll probably want access to: message.Message
to get the actual message that you sent.
The initial confirmation request sent out by Amazon is automatically confirmed at the same endpoint. No additional effort needed.
Signatures are automatically verified, but we can optionally verify the correct account id, region, and topics.
var auth = {
verify: false
};
var client = SNSClient(auth, function(err, message) {
console.log(message);
});
var auth = {
TopicArn: 'xxx'
};
var client = SNSClient(auth, function(err, message) {
console.log(message);
});
You should incude the body-parser module and use it to parse JSON.
var express = require('express')
, app = express.createServer()
, SNSClient = require('aws-snsclient');
var auth = {
TopicArn: 'xxx'
}
app.post('/receive', function(req, res, next) {
SNSClient.validateRequest(auth, req.body, function(err) {
//do something
});
});
app.listen(9000);
FAQs
A client for parsing Amazon AWS SNS requests.
The npm package aws-snsclient2 receives a total of 0 weekly downloads. As such, aws-snsclient2 popularity was classified as not popular.
We found that aws-snsclient2 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 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.