Code Monkey home page Code Monkey logo

node-aws-sign's Introduction

node-aws-sign

Simple module to calculate Authorization header for Amazon AWS REST requests.

Simple it is:

const AwsSign = require('aws-sign');
const signer = new AwsSign({
	accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
	secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
});

const opts = {
	method: 'PUT',
	host: 'johnsmith.s3.amazonaws.com',
	path: '/photos/puppy.jpg',
	headers: { ... },
	... // Other request options, ignored by AwsSign.
};
signer.sign(opts);
https.request(opts, ...);

The following keys are mandatory:

  • method
  • host
  • path

Others are optional. A date header (headers.date) will be added for you if it is not already set.

Non-goals

There is no support for path-style bucket access.

x-amz-date substitution is not supported because Node's http module has no problems setting Date header.

Multiple x-amz- keys are not supported. I.e. the following part of the example won't work:

X-Amz-Meta-ReviewedBy: [email protected]
X-Amz-Meta-ReviewedBy: [email protected]

Use a single header instead:

X-Amz-Meta-ReviewedBy: [email protected],[email protected]

Testing

mocha test/

Installation

npm install aws-sign

Author

Egor Egorov, [email protected].

License

MIT.

node-aws-sign's People

Contributors

btrask avatar egorfine avatar jamestalmage avatar kinke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-aws-sign's Issues

The version bump to 0.2.1 breaks anything running node before 8

There are a number of packages that depend on this one using a caret ^ version, which allows both minor and patch changes, and others which use ~ on the incorrectly published 0.2.0, but this is a major change.

I'd recommend unpublishing 0.2.1 and publishing as 2.0.0 or whatever major version, or at least publishing as 0.3.0.

path-style requests via proxy request is working...

Hy! I am using this lib, and the part of documentation you say that:
I.e. there is no support for path-style bucket access.

It's not right, i am using path-style requests to sign and proxy a request and i'ts working fine...
What is the point of this affirmation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.