Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
aws_es
Advanced tools
Readme
Creates a clone of the http class that signs each request before its sent.
Usage:
var elasticsearch = require('elasticsearch');
require('aws_es')(elasticsearch);
var client = new elasticsearch.Client({
host : 'xxxxx.es.amazonaws.com',
amazonES: {
region : 'us-east-1',
accessKey : 'XXXX',
secretKey : 'XXXX'
}
})
Config variables service
, region
, accessKey
and secretKey
can be defined in an amazonES
object at client creation. Alternatively, service defaults to 'es', region defaults to 'us-east-1' and the keys default to environment variables: AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
The complete code is as follows:
var aws4 = require('aws4');
module.exports = function(es) {
var pool = es.ConnectionPool,
http = pool.connectionClasses.http;
var aws = function() { http.apply(this,arguments); };
require('util').inherits(aws,http);
aws.prototype.createAgent = function(config) {
this._amazonES = config.amazonES || {};
http.prototype.createAgent.call(this,config);
};
aws.prototype.makeReqParams = function (_params) {
var params = http.prototype.makeReqParams.call(this,_params);
params.body = _params.body;
params.headers = params.headers || {};
params.headers['Content-Type'] = params.headers['Content-Type'] || 'application/json';
if (params.gzip === undefined) params.gzip = true;
var config = this._amazonES;
params.service = config.service || 'es';
params.region = config.region || 'us-east-1';
aws4.sign(params,{
accessKeyId: config.accessKey || process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: config.secretKey || process.env.AWS_SECRET_ACCESS_KEY
});
return params;
};
pool.defaultConnectionClass = 'aws';
pool.connectionClasses.aws = aws;
return es;
};
FAQs
Creates a clone of the http class that signs each request before its sent.
The npm package aws_es receives a total of 4 weekly downloads. As such, aws_es popularity was classified as not popular.
We found that aws_es 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.