Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nisaacson/aws-v4-sign-small

Size optimized library to perform AWS V4 request signing designed for use in the browser
https://github.com/nisaacson/aws-v4-sign-small

Last synced: 7 days ago
JSON representation

Size optimized library to perform AWS V4 request signing designed for use in the browser

Awesome Lists containing this project

README

        

# aws-v4-sign-small

Size optimized library to perform AWS V4 request signing designed for use in the browser. Forked from [aws4](https://github.com/mhart/aws4)

[![NPM](https://nodei.co/npm/aws-v4-sign-small.png)](https://nodei.co/npm/aws-v4-sign-small/)

# Installation

```
npm install --save aws-v4-sign-small
```

# Usage

## via browserify/require

```js
var aws4 = require('aws-v4-sign-small')
var opts = {
host: 'sqs.us-east-1.amazonaws.com',
path: '/'
query: '?Action=ListQueues'
}

var keys = {accessKeyId: 'access_key_here', secretAccessKey: 'secret_here'}
aws4.sign(opts, keys)
console.log('signed options: ', opts)
```

## globally in browser

```js

var aws4 = require('aws-v4-sign-small')
var opts = {
host: 'sqs.us-east-1.amazonaws.com',
path: '/'
query: '?Action=ListQueues'
}

var keys = {accessKeyId: 'access_key_here', secretAccessKey: 'secret_here'}
aws4.sign(opts, keys)
console.log('signed options: ', opts)

```

# Testing

```sh
AWS_ACCESS_KEY=access_key_here AWS_SECRET_ACCESS_KEY=secret_here npm run test
```

# Attributions

This project is uses source code from [aws4](https://github.com/mhart/aws4) by [Michael Hart](https://github.com/mhart). Some dependencies are changed to make the package smaller when using in the browser. Some of the utility functions in aws4 have been dropped as well to keep the size down