Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws4

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws4 - npm Package Compare versions

Comparing version 0.1.12 to 0.2.0

21

aws4.js

@@ -1,4 +0,6 @@

var aws4 = exports,
url = require('url'),
crypto = require('crypto')
var aws4 = exports,
url = require('url'),
crypto = require('crypto'),
lru = require('lru-cache'),
credentialsCache = lru(1000)

@@ -96,6 +98,11 @@ // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html

RequestSigner.prototype.signature = function() {
var kDate = hmac('AWS4' + this.credentials.secretAccessKey, this.date),
kRegion = hmac(kDate, this.region),
kService = hmac(kRegion, this.service),
kCredentials = hmac(kService, 'aws4_request')
var cacheKey = [this.credentials.secretAccessKey, this.date, this.region, this.service].join(),
kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
if (!kCredentials) {
kDate = hmac('AWS4' + this.credentials.secretAccessKey, this.date)
kRegion = hmac(kDate, this.region)
kService = hmac(kRegion, this.service)
kCredentials = hmac(kService, 'aws4_request')
credentialsCache.set(cacheKey, kCredentials)
}
return hmac(kCredentials, this.stringToSign(), 'hex')

@@ -102,0 +109,0 @@ }

{
"name": "aws4",
"version": "0.1.12",
"version": "0.2.0",
"description": "Signs and prepares requests using AWS Signature Version 4",

@@ -38,2 +38,5 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)",

"license": "MIT",
"dependencies": {
"lru-cache": "~2.3.1"
},
"devDependencies": {

@@ -40,0 +43,0 @@ "should": "~1.2.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc