Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 30, 2024 via pnpm

aws4 1.12.0

Signs and prepares requests using AWS Signature Version 4
Package summary
Share
0
issues
1
license
1
MIT
Package created
26 Dec 2012
Version published
7 Jan 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
aws4@1.12.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of aws4 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does aws4 do?

The aws4 npm package is a compact utility that signs vanilla Node.js http(s) request options using Amazon's AWS Signature Version 4. This assists in bolstering the authentication of your AWS services which, with the exception of SimpleDB, all support AWS Signature Version 4. The module not only signs your requests, but also provides defaults for numerous core AWS request headers and parameters to simplify developing on AWS services.

How do you use aws4?

Using aws4 is quite straightforward and flexible. It is designed to work with the objects you would typically pass as options to Node.js's http(s) request methods. Here is a simplified example with Node.js's https library:

var https = require('https')
var aws4 = require('aws4')

function request(opts) { https.request(opts, function(res) { res.pipe(process.stdout) }).end(opts.body || '') }

var opts = { host: 'my-bucket.s3.us-west-1.amazonaws.com', path: '/my-object' }

aws4.sign(opts)
request(opts)

In this example, a simple HTTP request is made to an S3 bucket. Before making the request, it's signed by aws4, which enhances request authentication. aws4 also allows you to pass AWS service specific regions, add headers, or even sign the query if needed. You can find more detailed and elaborate examples in the official documentation.

Your AWS credentials can be specified either as the second argument in the aws4.sign function:

aws4.sign(requestOptions, {
  secretAccessKey: "<your-secret-access-key>",
  accessKeyId: "<your-access-key-id>",
  sessionToken: "<your-session-token>"
})

Or it can automatically read from your environment variables:

export AWS_ACCESS_KEY_ID="<your-access-key-id>"
export AWS_SECRET_ACCESS_KEY="<your-secret-access-key>"
export AWS_SESSION_TOKEN="<your-session-token>"

Where are the aws4 docs?

The official documentation for the AWS4 npm package can be found on npmjs.com and the Github page. Here, you can get more in-depth information on the full capabilities of the package, additional example usages, installation steps and more. Also given its popularity and wide usage, there are various blogs and third-party sites offering guides and tutorials on how to harness the power of AWS4 in your JavaScript project.