New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alexa-verifier

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alexa-verifier - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

32

fetch-cert.js

@@ -1,7 +0,8 @@

var request = require('request')
'use strict'
var https = require('https')
// default in-memory cache for downloaded certificates
var globalCache = {}
var globalCache = {} // default in-memory cache for downloaded certificates
module.exports = function fetchCert(options, callback) {

@@ -18,12 +19,25 @@ var url = options.url

request.get(url.href, function(er, response, body) {
var body = ''
https.get(url.href, function(response) {
var statusCode
if (response && 200 === response.statusCode) {
if (!response || 200 !== response.statusCode) {
statusCode = response ? response.statusCode : 0
return callback('Failed to download certificate at: ' + url.href + '. Response code: ' + statusCode)
}
response.setEncoding('utf8')
response.on('data', function (chunk) {
body += chunk
})
response.on('end', function () {
cache[url.href] = body
callback(undefined, body, servedFromCache)
} else {
statusCode = response ? response.statusCode : 0
callback('Failed to download certificate at: ' + url.href + '. Response code: ' + statusCode + ', error: ' + er)
}
})
})
.on('error', function(er) {
console.error('balls2!', er)
callback('Failed to download certificate at: ' + url.href +'. Error: ' + er)
})
}

@@ -0,4 +1,5 @@

'use strict'
var crypto = require('crypto')
var fetchCert = require('./fetch-cert')
var request = require('request')
var url = require('url')

@@ -5,0 +6,0 @@ var validateCert = require('./validate-cert')

{
"name": "alexa-verifier",
"version": "0.4.0",
"version": "0.5.0",
"description": "Verify HTTP requests sent to an Alexa skill are sent from Amazon",

@@ -17,3 +17,2 @@ "main": "index.js",

"node-forge": "^0.7.0",
"request": "^2.67.0",
"validator": "^8.0.0"

@@ -23,5 +22,5 @@ },

"nock": "^9.0.2",
"sinon": "^3.2.1",
"tap": "^10.3.0",
"unroll": "^1.1.0",
"sinon": "^3.2.1"
"unroll": "1.4.0"
},

@@ -28,0 +27,0 @@ "engine": {

@@ -0,1 +1,3 @@

'use strict'
var fetchCert = require('../fetch-cert')

@@ -2,0 +4,0 @@ var nock = require('nock')

@@ -0,1 +1,3 @@

'use strict'
var test = require('tap').test

@@ -2,0 +4,0 @@ var url = require('url')

@@ -0,1 +1,3 @@

'use strict'
var test = require('tap').test

@@ -2,0 +4,0 @@ var unroll = require('unroll')

@@ -0,1 +1,3 @@

'use strict'
var fs = require('fs')

@@ -2,0 +4,0 @@ var pki = require('node-forge').pki

@@ -0,1 +1,3 @@

'use strict'
// constants

@@ -2,0 +4,0 @@ var VALID_CERT_HOSTNAME = 's3.amazonaws.com'

@@ -0,1 +1,3 @@

'use strict'
var pki = require('node-forge').pki

@@ -2,0 +4,0 @@

Sorry, the diff of this file is not supported yet

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