Socket
Book a DemoInstallSign in
Socket

aws-signed-request

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-signed-request

Helper to send signed request from a lambda

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Signed AWS requests

Module to send signed requests to an AWS service.

Heavily inspired by aws samples.

Install

npm install --save aws-signed-request

Usage

ElasticSearch

var elastic = require('aws-signed-request')({
	endpoint: 'htps://your.elasticsearch.es.amazon.com',
	region: 'eu-west-1',
	service: 'es'
});

elastic.send({
	method: 'GET',
	path: '/domain/index/id'
}, function (err, data) {
	console.log(data);
});

API Gateway

var gateway = require('aws-signed-request')({
	endpoint: 'https://your.api.gateway.amazon.com',
	region: 'eu-west-1',
	service: 'execute-api'
});

gateway.send({
	method: 'POST',
	path: '/action'
}, function (err, data) {
	console.log(data);
});

Advanced usage

By default the module expects a JSON response. If you're expecting plain text you can call

elastic.send({
	method: 'GET',
	path: '/_cat/indices',
	json: false
}, function (err, data) {
	console.log(data); // as plain text
});

If json:true and the response is not a valid JSON, the callback receives an error containing responseText for debug purposes.

Contribute

Clone the repo, write some test, make them pass and pull request your changes.

You can watch your tests by running

npm install -g watch
watch "npm test" . -d

Keywords

aws

FAQs

Package last updated on 07 Apr 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.