From 80ab521f18d34df109de0c5dc9eb1cde5ff6d7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 30 May 2017 22:51:59 -0700 Subject: deps: pull in dependency updates with bugfixes * new pacote fixes several git-related bugs * ssri update fixes crash on early node@4 versions * make-fetch-happen update fixes more proxy-related issues * npm-user-validate adds regex for blocking usernames with illegal chars Credit: @zkat --- node_modules/cacache/CHANGELOG.md | 10 ++ node_modules/cacache/package.json | 24 ++-- node_modules/npm-user-validate/.npmignore | 13 -- node_modules/npm-user-validate/.travis.yml | 7 - .../npm-user-validate/npm-user-validate.js | 15 +- node_modules/npm-user-validate/package.json | 39 +++--- node_modules/npm-user-validate/test/email.test.js | 26 ---- node_modules/npm-user-validate/test/pw.test.js | 32 ----- .../npm-user-validate/test/username.test.js | 42 ------ node_modules/pacote/CHANGELOG.md | 31 +++++ node_modules/pacote/lib/fetchers/git.js | 11 +- node_modules/pacote/lib/util/git.js | 3 +- .../node_modules/make-fetch-happen/CHANGELOG.md | 11 ++ .../pacote/node_modules/make-fetch-happen/agent.js | 1 + .../node_modules/agent-base/.travis.yml | 27 +++- .../node_modules/agent-base/History.md | 18 +++ .../node_modules/agent-base/agent.js | 11 +- .../node_modules/agent-base/package.json | 18 ++- .../node_modules/agent-base/test/test.js | 155 ++++++++++++++++++++- .../node_modules/agent-base/.travis.yml | 27 +++- .../node_modules/agent-base/History.md | 18 +++ .../node_modules/agent-base/agent.js | 11 +- .../node_modules/agent-base/package.json | 18 ++- .../node_modules/agent-base/test/test.js | 155 ++++++++++++++++++++- .../node_modules/agent-base/.travis.yml | 27 +++- .../node_modules/agent-base/History.md | 18 +++ .../node_modules/agent-base/agent.js | 11 +- .../node_modules/agent-base/package.json | 18 ++- .../node_modules/agent-base/test/test.js | 155 ++++++++++++++++++++- .../node_modules/make-fetch-happen/package.json | 26 ++-- node_modules/pacote/package.json | 30 ++-- node_modules/ssri/CHANGELOG.md | 10 ++ node_modules/ssri/index.js | 10 +- node_modules/ssri/package.json | 24 ++-- 34 files changed, 793 insertions(+), 259 deletions(-) delete mode 100644 node_modules/npm-user-validate/.npmignore delete mode 100644 node_modules/npm-user-validate/.travis.yml delete mode 100644 node_modules/npm-user-validate/test/email.test.js delete mode 100644 node_modules/npm-user-validate/test/pw.test.js delete mode 100644 node_modules/npm-user-validate/test/username.test.js (limited to 'node_modules') diff --git a/node_modules/cacache/CHANGELOG.md b/node_modules/cacache/CHANGELOG.md index 8235212ad..fad0f4875 100644 --- a/node_modules/cacache/CHANGELOG.md +++ b/node_modules/cacache/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [9.2.6](https://github.com/zkat/cacache/compare/v9.2.5...v9.2.6) (2017-05-31) + + +### Bug Fixes + +* **node:** update ssri to prevent old node 4 crash ([5209ffe](https://github.com/zkat/cacache/commit/5209ffe)) + + + ## [9.2.5](https://github.com/zkat/cacache/compare/v9.2.4...v9.2.5) (2017-05-25) diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 26b8e826f..16266eb05 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,19 +1,19 @@ { - "_from": "cacache@9.2.5", - "_id": "cacache@9.2.5", + "_from": "cacache@9.2.6", + "_id": "cacache@9.2.6", "_inBundle": false, - "_integrity": "sha512-mURsTvkjbCSFRTdkuPhHUp9sbEHn3AVrvM4mveg/bhlKKYolfRm23TsFUVAssC9p622lwmh7pgpb+H5mSVpYcA==", + "_integrity": "sha512-YK0Z5Np5t755edPL6gfdCeGxtU0rcW/DBhYhYVDckT+7AFkCCtedf2zru5NRbBLFk6e7Agi/RaqTOAfiaipUfg==", "_location": "/cacache", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "cacache@9.2.5", + "raw": "cacache@9.2.6", "name": "cacache", "escapedName": "cacache", - "rawSpec": "9.2.5", + "rawSpec": "9.2.6", "saveSpec": null, - "fetchSpec": "9.2.5" + "fetchSpec": "9.2.6" }, "_requiredBy": [ "#USER", @@ -21,10 +21,10 @@ "/pacote", "/pacote/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/cacache/-/cacache-9.2.5.tgz", - "_shasum": "cb401d0e59858532062de1f104097cb40c71c3bf", - "_spec": "cacache@9.2.5", - "_where": "/Users/rebecca/code/npm", + "_resolved": "https://registry.npmjs.org/cacache/-/cacache-9.2.6.tgz", + "_shasum": "ea5c7f2b6b514710a22a58a27f857fd972fdfa51", + "_spec": "cacache@9.2.6", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -66,7 +66,7 @@ "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", "rimraf": "^2.6.1", - "ssri": "^4.1.3", + "ssri": "^4.1.4", "unique-filename": "^1.1.0", "y18n": "^3.2.1" }, @@ -125,5 +125,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "9.2.5" + "version": "9.2.6" } diff --git a/node_modules/npm-user-validate/.npmignore b/node_modules/npm-user-validate/.npmignore deleted file mode 100644 index 39747c08b..000000000 --- a/node_modules/npm-user-validate/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -*.swp -.*.swp - -.DS_Store -*~ -.project -.settings -npm-debug.log -coverage.html -.idea -lib-cov - -node_modules \ No newline at end of file diff --git a/node_modules/npm-user-validate/.travis.yml b/node_modules/npm-user-validate/.travis.yml deleted file mode 100644 index 6ff074b74..000000000 --- a/node_modules/npm-user-validate/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -before_install: -- npm install -g npm@latest -sudo: false -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/npm-user-validate/npm-user-validate.js b/node_modules/npm-user-validate/npm-user-validate.js index 3a645ec93..9250ce33a 100644 --- a/node_modules/npm-user-validate/npm-user-validate.js +++ b/node_modules/npm-user-validate/npm-user-validate.js @@ -1,19 +1,23 @@ exports.email = email exports.pw = pw exports.username = username - var requirements = exports.requirements = { username: { length: 'Name length must be less than or equal to 214 characters long', lowerCase: 'Name must be lowercase', urlSafe: 'Name may not contain non-url-safe chars', - dot: 'Name may not start with "."' + dot: 'Name may not start with "."', + illegal: 'Name may not contain illegal character' }, password: {}, email: { valid: 'Email must be an email address' } -}; +} + +var illegalCharacterRe = new RegExp('([' + [ + "'" +].join() + '])') function username (un) { if (un !== un.toLowerCase()) { @@ -32,6 +36,11 @@ function username (un) { return new Error(requirements.username.length) } + var illegal = un.match(illegalCharacterRe) + if (illegal) { + return new Error(requirements.username.illegal + ' "' + illegal[0] + '"') + } + return null } diff --git a/node_modules/npm-user-validate/package.json b/node_modules/npm-user-validate/package.json index d6e30bd54..df646cd05 100644 --- a/node_modules/npm-user-validate/package.json +++ b/node_modules/npm-user-validate/package.json @@ -1,42 +1,46 @@ { - "_from": "npm-user-validate@~0.1.5", - "_id": "npm-user-validate@0.1.5", - "_integrity": "sha1-UkZdUMLSApSlcSW5lrrtv1bFAEs=", + "_from": "npm-user-validate@latest", + "_id": "npm-user-validate@1.0.0", + "_inBundle": false, + "_integrity": "sha1-jOyg9c6gTU6TUZ73LQVXp1Ei6VE=", "_location": "/npm-user-validate", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "tag", "registry": true, - "raw": "npm-user-validate@~0.1.5", + "raw": "npm-user-validate@latest", "name": "npm-user-validate", "escapedName": "npm-user-validate", - "rawSpec": "~0.1.5", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "~0.1.5" + "fetchSpec": "latest" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz", - "_shasum": "52465d50c2d20294a57125b996baedbf56c5004b", - "_shrinkwrap": null, - "_spec": "npm-user-validate@~0.1.5", + "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.0.tgz", + "_shasum": "8ceca0f5cea04d4e93519ef72d0557a75122e951", + "_spec": "npm-user-validate@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Robert Kowalski", "email": "rok@kowalski.gd" }, - "bin": null, "bugs": { "url": "https://github.com/npm/npm-user-validate/issues" }, "bundleDependencies": false, - "dependencies": {}, "deprecated": false, "description": "User validations for npm", "devDependencies": { - "tap": "^1.2.0" + "standard": "^8.4.0", + "standard-version": "^3.0.0", + "tap": "^7.1.2" }, + "files": [ + "npm-user-validate.js" + ], "homepage": "https://github.com/npm/npm-user-validate#readme", "keywords": [ "npm", @@ -46,14 +50,13 @@ "license": "BSD-2-Clause", "main": "npm-user-validate.js", "name": "npm-user-validate", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/npm/npm-user-validate.git" }, "scripts": { - "test": "tap test/*.js" + "pretest": "standard", + "test": "tap --100 test/*.js" }, - "version": "0.1.5" + "version": "1.0.0" } diff --git a/node_modules/npm-user-validate/test/email.test.js b/node_modules/npm-user-validate/test/email.test.js deleted file mode 100644 index 1060a9354..000000000 --- a/node_modules/npm-user-validate/test/email.test.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test -var v = require('../npm-user-validate.js').email - -test('email misses an @', function (t) { - err = v('namedomain') - t.type(err, 'object') - t.end() -}) - -test('email misses a dot', function (t) { - err = v('name@domain') - t.type(err, 'object') - t.end() -}) - -test('email misses a string before the @', function (t) { - err = v('@domain') - t.type(err, 'object') - t.end() -}) - -test('email is ok', function (t) { - err = v('name@domain.com') - t.type(err, 'null') - t.end() -}) \ No newline at end of file diff --git a/node_modules/npm-user-validate/test/pw.test.js b/node_modules/npm-user-validate/test/pw.test.js deleted file mode 100644 index d57401da0..000000000 --- a/node_modules/npm-user-validate/test/pw.test.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tap').test -var v = require('../npm-user-validate.js').pw - -test('pw contains a \'', function (t) { - err = v('\'') - t.type(err, 'null') - t.end() -}) - -test('pw contains a :', function (t) { - err = v(':') - t.type(err, 'null') - t.end() -}) - -test('pw contains a @', function (t) { - err = v('@') - t.notOk(err, 'null') - t.end() -}) - -test('pw contains a "', function (t) { - err = v('"') - t.type(err, 'null') - t.end() -}) - -test('pw is ok', function (t) { - err = v('duck') - t.type(err, 'null') - t.end() -}) diff --git a/node_modules/npm-user-validate/test/username.test.js b/node_modules/npm-user-validate/test/username.test.js deleted file mode 100644 index aa0e6b33d..000000000 --- a/node_modules/npm-user-validate/test/username.test.js +++ /dev/null @@ -1,42 +0,0 @@ -var test = require('tap').test -var v = require('../npm-user-validate.js').username - -test('username must be lowercase', function (t) { - var err = v('ERRR') - t.type(err, 'object') - t.match(err.message, /lowercase/) - t.end() -}) - -test('username may not contain non-url-safe chars', function (t) { - var err = v('f ') - t.type(err, 'object') - t.match(err.message, /url-safe/) - t.end() -}) - -test('username may not start with "."', function (t) { - var err = v('.username') - t.type(err, 'object') - t.match(err.message, /start with.*\./) - t.end() -}) - -test('username may not be longer than 214 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-and-pickle') - t.type(err, 'object') - t.match(err.message, /less than or equal to 214/) - t.end() -}); - -test('username may be as long as 214 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-porchetta') - t.type(err, 'null') - t.end() -}); - -test('username is ok', function (t) { - var err = v('ente') - t.type(err, 'null') - t.end() -}) diff --git a/node_modules/pacote/CHANGELOG.md b/node_modules/pacote/CHANGELOG.md index 55c0cda68..8d3e04a5a 100644 --- a/node_modules/pacote/CHANGELOG.md +++ b/node_modules/pacote/CHANGELOG.md @@ -2,6 +2,37 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.7.24](https://github.com/zkat/pacote/compare/v2.7.23...v2.7.24) (2017-05-31) + + +### Bug Fixes + +* **deps:** update dep versions with new patches ([dc2e4ff](https://github.com/zkat/pacote/commit/dc2e4ff)) + + + + +## [2.7.23](https://github.com/zkat/pacote/compare/v2.7.22...v2.7.23) (2017-05-31) + + +### Bug Fixes + +* **git:** fix ls-remote command and throw away ^{} junk ([62ba84d](https://github.com/zkat/pacote/commit/62ba84d)) +* **git:** use the parsed git committish from npa ([77a676a](https://github.com/zkat/pacote/commit/77a676a)) + + + + +## [2.7.22](https://github.com/zkat/pacote/compare/v2.7.21...v2.7.22) (2017-05-31) + + +### Bug Fixes + +* **git:** accept shortened git hashes (#91) ([4466388](https://github.com/zkat/pacote/commit/4466388)) + + + ## [2.7.21](https://github.com/zkat/pacote/compare/v2.7.20...v2.7.21) (2017-05-25) diff --git a/node_modules/pacote/lib/fetchers/git.js b/node_modules/pacote/lib/fetchers/git.js index d8af76936..6887277ce 100644 --- a/node_modules/pacote/lib/fetchers/git.js +++ b/node_modules/pacote/lib/fetchers/git.js @@ -102,7 +102,7 @@ function hostedManifest (spec, opts) { } function plainManifest (repo, spec, opts) { - const rawRef = spec.gitCommittish + const rawRef = spec.gitCommittish || spec.gitRange return resolve( repo, rawRef, spec.name, opts ).then(ref => { @@ -125,23 +125,22 @@ function plainManifest (repo, spec, opts) { return { _repo: repo, _rawRef: rawRef, - _resolved: rawRef.match(/^[a-f0-9]{40}$/) && resolved, - _uniqueResolved: rawRef.match(/^[a-f0-9]{40}$/) && resolved + _resolved: rawRef.match(/^[a-f0-9]$/) && resolved, + _uniqueResolved: rawRef.match(/^[a-f0-9]$/) && resolved } } }) } function resolve (url, rawRef, name, opts) { - const semverMatch = rawRef.match(/^semver:v?(.*)/) - const isSemver = semverMatch && semver.validRange(semverMatch[1]) + const isSemver = semver.validRange(rawRef) return git.revs(url, opts).then(remoteRefs => { return isSemver ? pickManifest({ versions: remoteRefs.versions, 'dist-tags': remoteRefs['dist-tags'], name: name - }, semverMatch[1], opts) + }, rawRef, opts) : remoteRefs ? BB.resolve( remoteRefs.refs[rawRef] || remoteRefs.refs[remoteRefs.shas[rawRef]] diff --git a/node_modules/pacote/lib/util/git.js b/node_modules/pacote/lib/util/git.js index dc189b541..6a82776a2 100644 --- a/node_modules/pacote/lib/util/git.js +++ b/node_modules/pacote/lib/util/git.js @@ -105,7 +105,7 @@ function revs (repo, opts) { return BB.resolve(cached) } return pinflight(`ls-remote:${repo}`, () => { - return spawnGit(['ls-remote', repo, '-t', '-h', '*'], { + return spawnGit(['ls-remote', repo], { env: gitEnv() }, opts).then(child => { let stdout = '' @@ -117,6 +117,7 @@ function revs (repo, opts) { const sha = split[0].trim() const ref = split[1].trim().match(/(?:refs\/[^/]+\/)?(.*)/)[1] if (!ref) { return revs } // ??? + if (ref.match(/\^\{\}$/)) { return revs } // refs/tags/x^{} crap const type = refType(line) const doc = {sha, ref, type} diff --git a/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md b/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md index 854388027..8e81398e1 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.4.10](https://github.com/zkat/make-fetch-happen/compare/v2.4.9...v2.4.10) (2017-05-31) + + +### Bug Fixes + +* **deps:** bump dep versions with bugfixes ([0af4003](https://github.com/zkat/make-fetch-happen/commit/0af4003)) +* **proxy:** use auth parameter for proxy authentication (#30) ([c687306](https://github.com/zkat/make-fetch-happen/commit/c687306)) + + + ## [2.4.9](https://github.com/zkat/make-fetch-happen/compare/v2.4.8...v2.4.9) (2017-05-25) diff --git a/node_modules/pacote/node_modules/make-fetch-happen/agent.js b/node_modules/pacote/node_modules/make-fetch-happen/agent.js index 010049894..a3c910eb9 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/agent.js @@ -126,6 +126,7 @@ function getProxy (proxyUrl, opts, isHttps) { port: proxyUrl.port, protocol: proxyUrl.protocol, path: proxyUrl.path, + auth: proxyUrl.auth, ca: opts.ca, cert: opts.cert, key: opts.key, diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/.travis.yml b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/.travis.yml index 85a50123c..20b794051 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/.travis.yml +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/.travis.yml @@ -1,8 +1,29 @@ +sudo: false + language: node_js + node_js: - "0.8" - "0.10" - "0.12" -before_install: - - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' - - npm install -g npm@latest + - "1" + - "2" + - "3" + - "4" + - "5" + - "6" + - "7" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/History.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/History.md index 0ceef6c13..2191a9e80 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/History.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/History.md @@ -1,4 +1,22 @@ +2.1.1 / 2017-05-30 +================== + + * Revert [fe2162e0ba18123f5b301cba4de1e9dd74e437cd](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [270bdc92eb8e3bd0444d1e5266e8e9390aeb3095](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) + +2.1.0 / 2017-05-26 +================== + + * unref is not supported for node < 0.9.1 (@pi0) + * add tests to dangling socket (@pi0) + * check unref() is supported (@pi0) + * fix dangling sockets problem (@pi0) + * add basic "ws" module tests + * make `Agent` be subclassable + * turn `addRequest()` into a named function + * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) + * travis: test node v4, v5, v6 and v7 + 2.0.1 / 2015-09-10 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/agent.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/agent.js index 4005ebc0e..7ea91f886 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/agent.js @@ -24,12 +24,17 @@ module.exports = Agent; function Agent (callback) { if (!(this instanceof Agent)) return new Agent(callback); - if ('function' != typeof callback) throw new Error('Must pass a "callback function"'); EventEmitter.call(this); - this.callback = callback; + if ('function' === typeof callback) { + this.callback = callback; + } } inherits(Agent, EventEmitter); +Agent.prototype.callback = function callback (req, opts, fn) { + fn(new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')); +}; + /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. @@ -37,7 +42,7 @@ inherits(Agent, EventEmitter); * @api public */ -Agent.prototype.addRequest = function (req, host, port, localAddress) { +Agent.prototype.addRequest = function addRequest (req, host, port, localAddress) { var opts; if ('object' == typeof host) { // >= v0.11.x API diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/package.json index 0e296ced0..f74df4fcb 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/package.json @@ -1,7 +1,8 @@ { "_from": "agent-base@2", - "_id": "agent-base@2.0.1", - "_integrity": "sha1-vY+ehqjrIh//oHvRS+/VXfFCgV4=", + "_id": "agent-base@2.1.1", + "_inBundle": false, + "_integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", "_location": "/pacote/make-fetch-happen/http-proxy-agent/agent-base", "_phantomChildren": {}, "_requested": { @@ -17,9 +18,8 @@ "_requiredBy": [ "/pacote/make-fetch-happen/http-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.0.1.tgz", - "_shasum": "bd8f9e86a8eb221fffa07bd14befd55df142815e", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "_shasum": "d6de10d5af6132d5bd692427d46fc538539094c7", "_spec": "agent-base@2", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent", "author": { @@ -27,7 +27,6 @@ "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, - "bin": null, "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, @@ -39,7 +38,8 @@ "deprecated": false, "description": "Turn a function into an `http.Agent` instance", "devDependencies": { - "mocha": "2" + "mocha": "2", + "ws": "0.8.0" }, "homepage": "https://github.com/TooTallNate/node-agent-base#readme", "keywords": [ @@ -52,8 +52,6 @@ "license": "MIT", "main": "agent.js", "name": "agent-base", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" @@ -61,5 +59,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "2.0.1" + "version": "2.1.1" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/test/test.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/test/test.js index f87d308f8..7d8dee66c 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/test/test.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/node_modules/agent-base/test/test.js @@ -9,13 +9,45 @@ var net = require('net'); var tls = require('tls'); var http = require('http'); var https = require('https'); +var WebSocket = require('ws'); var assert = require('assert'); var events = require('events'); +var inherits = require('util').inherits; +var semver = require('semver'); var Agent = require('../'); describe('Agent', function () { + describe('subclass', function () { + it('should be subclassable', function (done) { + function MyAgent () { + Agent.call(this); + } + inherits(MyAgent, Agent); + + MyAgent.prototype.callback = function (req, opts, fn) { + assert.equal(req.path, '/foo'); + assert.equal(req.getHeader('host'), '127.0.0.1:1234'); + assert.equal(opts.secureEndpoint, true); + done(); + }; + + var info = url.parse('https://127.0.0.1:1234/foo'); + info.agent = new MyAgent; + https.get(info); + }); + }); describe('"error" event', function () { - it('should be invoked on `http.ClientRequest` instance if passed to callback function on the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function (done) { + var agent = new Agent(); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function (err) { + assert.equal('"agent-base" has no default implementation, you must subclass and override `callback()`', err.message); + done(); + }); + }); + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { fn(new Error('is this caught?')); }); @@ -27,7 +59,7 @@ describe('Agent', function () { done(); }); }); - it('should be invoked on `http.ClientRequest` instance if passed to callback function after the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { setTimeout(function () { fn(new Error('is this caught?')); @@ -54,6 +86,10 @@ describe('Agent', function () { done(); }; + // needed for `http` module in Node.js 4 + stream.cork = function () { + }; + var opts = { method: 'GET', host: '127.0.0.1', @@ -298,3 +334,118 @@ describe('"https" module', function () { }); }); }); + +describe('"ws" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + server = http.createServer() + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for basic WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = net.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('ws://127.0.0.1:' + port + '/', { + agent: agent + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); + +describe('"wss" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + var options = { + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') + }; + server = https.createServer(options); + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for secure WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = tls.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('wss://127.0.0.1:' + port + '/', { + agent: agent, + rejectUnauthorized: false + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/.travis.yml b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/.travis.yml index 85a50123c..20b794051 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/.travis.yml +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/.travis.yml @@ -1,8 +1,29 @@ +sudo: false + language: node_js + node_js: - "0.8" - "0.10" - "0.12" -before_install: - - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' - - npm install -g npm@latest + - "1" + - "2" + - "3" + - "4" + - "5" + - "6" + - "7" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/History.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/History.md index 0ceef6c13..2191a9e80 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/History.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/History.md @@ -1,4 +1,22 @@ +2.1.1 / 2017-05-30 +================== + + * Revert [fe2162e0ba18123f5b301cba4de1e9dd74e437cd](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [270bdc92eb8e3bd0444d1e5266e8e9390aeb3095](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) + +2.1.0 / 2017-05-26 +================== + + * unref is not supported for node < 0.9.1 (@pi0) + * add tests to dangling socket (@pi0) + * check unref() is supported (@pi0) + * fix dangling sockets problem (@pi0) + * add basic "ws" module tests + * make `Agent` be subclassable + * turn `addRequest()` into a named function + * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) + * travis: test node v4, v5, v6 and v7 + 2.0.1 / 2015-09-10 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/agent.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/agent.js index 4005ebc0e..7ea91f886 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/agent.js @@ -24,12 +24,17 @@ module.exports = Agent; function Agent (callback) { if (!(this instanceof Agent)) return new Agent(callback); - if ('function' != typeof callback) throw new Error('Must pass a "callback function"'); EventEmitter.call(this); - this.callback = callback; + if ('function' === typeof callback) { + this.callback = callback; + } } inherits(Agent, EventEmitter); +Agent.prototype.callback = function callback (req, opts, fn) { + fn(new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')); +}; + /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. @@ -37,7 +42,7 @@ inherits(Agent, EventEmitter); * @api public */ -Agent.prototype.addRequest = function (req, host, port, localAddress) { +Agent.prototype.addRequest = function addRequest (req, host, port, localAddress) { var opts; if ('object' == typeof host) { // >= v0.11.x API diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/package.json index b57e81b1b..9dedd7231 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/package.json @@ -1,7 +1,8 @@ { "_from": "agent-base@2", - "_id": "agent-base@2.0.1", - "_integrity": "sha1-vY+ehqjrIh//oHvRS+/VXfFCgV4=", + "_id": "agent-base@2.1.1", + "_inBundle": false, + "_integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", "_location": "/pacote/make-fetch-happen/https-proxy-agent/agent-base", "_phantomChildren": {}, "_requested": { @@ -17,9 +18,8 @@ "_requiredBy": [ "/pacote/make-fetch-happen/https-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.0.1.tgz", - "_shasum": "bd8f9e86a8eb221fffa07bd14befd55df142815e", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "_shasum": "d6de10d5af6132d5bd692427d46fc538539094c7", "_spec": "agent-base@2", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent", "author": { @@ -27,7 +27,6 @@ "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, - "bin": null, "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, @@ -39,7 +38,8 @@ "deprecated": false, "description": "Turn a function into an `http.Agent` instance", "devDependencies": { - "mocha": "2" + "mocha": "2", + "ws": "0.8.0" }, "homepage": "https://github.com/TooTallNate/node-agent-base#readme", "keywords": [ @@ -52,8 +52,6 @@ "license": "MIT", "main": "agent.js", "name": "agent-base", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" @@ -61,5 +59,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "2.0.1" + "version": "2.1.1" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/test/test.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/test/test.js index f87d308f8..7d8dee66c 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/test/test.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/agent-base/test/test.js @@ -9,13 +9,45 @@ var net = require('net'); var tls = require('tls'); var http = require('http'); var https = require('https'); +var WebSocket = require('ws'); var assert = require('assert'); var events = require('events'); +var inherits = require('util').inherits; +var semver = require('semver'); var Agent = require('../'); describe('Agent', function () { + describe('subclass', function () { + it('should be subclassable', function (done) { + function MyAgent () { + Agent.call(this); + } + inherits(MyAgent, Agent); + + MyAgent.prototype.callback = function (req, opts, fn) { + assert.equal(req.path, '/foo'); + assert.equal(req.getHeader('host'), '127.0.0.1:1234'); + assert.equal(opts.secureEndpoint, true); + done(); + }; + + var info = url.parse('https://127.0.0.1:1234/foo'); + info.agent = new MyAgent; + https.get(info); + }); + }); describe('"error" event', function () { - it('should be invoked on `http.ClientRequest` instance if passed to callback function on the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function (done) { + var agent = new Agent(); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function (err) { + assert.equal('"agent-base" has no default implementation, you must subclass and override `callback()`', err.message); + done(); + }); + }); + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { fn(new Error('is this caught?')); }); @@ -27,7 +59,7 @@ describe('Agent', function () { done(); }); }); - it('should be invoked on `http.ClientRequest` instance if passed to callback function after the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { setTimeout(function () { fn(new Error('is this caught?')); @@ -54,6 +86,10 @@ describe('Agent', function () { done(); }; + // needed for `http` module in Node.js 4 + stream.cork = function () { + }; + var opts = { method: 'GET', host: '127.0.0.1', @@ -298,3 +334,118 @@ describe('"https" module', function () { }); }); }); + +describe('"ws" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + server = http.createServer() + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for basic WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = net.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('ws://127.0.0.1:' + port + '/', { + agent: agent + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); + +describe('"wss" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + var options = { + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') + }; + server = https.createServer(options); + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for secure WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = tls.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('wss://127.0.0.1:' + port + '/', { + agent: agent, + rejectUnauthorized: false + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml index 85a50123c..20b794051 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml @@ -1,8 +1,29 @@ +sudo: false + language: node_js + node_js: - "0.8" - "0.10" - "0.12" -before_install: - - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' - - npm install -g npm@latest + - "1" + - "2" + - "3" + - "4" + - "5" + - "6" + - "7" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md index 0ceef6c13..2191a9e80 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md @@ -1,4 +1,22 @@ +2.1.1 / 2017-05-30 +================== + + * Revert [fe2162e0ba18123f5b301cba4de1e9dd74e437cd](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [270bdc92eb8e3bd0444d1e5266e8e9390aeb3095](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) + +2.1.0 / 2017-05-26 +================== + + * unref is not supported for node < 0.9.1 (@pi0) + * add tests to dangling socket (@pi0) + * check unref() is supported (@pi0) + * fix dangling sockets problem (@pi0) + * add basic "ws" module tests + * make `Agent` be subclassable + * turn `addRequest()` into a named function + * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) + * travis: test node v4, v5, v6 and v7 + 2.0.1 / 2015-09-10 ================== diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js index 4005ebc0e..7ea91f886 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js @@ -24,12 +24,17 @@ module.exports = Agent; function Agent (callback) { if (!(this instanceof Agent)) return new Agent(callback); - if ('function' != typeof callback) throw new Error('Must pass a "callback function"'); EventEmitter.call(this); - this.callback = callback; + if ('function' === typeof callback) { + this.callback = callback; + } } inherits(Agent, EventEmitter); +Agent.prototype.callback = function callback (req, opts, fn) { + fn(new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')); +}; + /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. @@ -37,7 +42,7 @@ inherits(Agent, EventEmitter); * @api public */ -Agent.prototype.addRequest = function (req, host, port, localAddress) { +Agent.prototype.addRequest = function addRequest (req, host, port, localAddress) { var opts; if ('object' == typeof host) { // >= v0.11.x API diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json index 81950940b..e20413153 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json @@ -1,7 +1,8 @@ { "_from": "agent-base@2", - "_id": "agent-base@2.0.1", - "_integrity": "sha1-vY+ehqjrIh//oHvRS+/VXfFCgV4=", + "_id": "agent-base@2.1.1", + "_inBundle": false, + "_integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", "_location": "/pacote/make-fetch-happen/socks-proxy-agent/agent-base", "_phantomChildren": {}, "_requested": { @@ -17,9 +18,8 @@ "_requiredBy": [ "/pacote/make-fetch-happen/socks-proxy-agent" ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.0.1.tgz", - "_shasum": "bd8f9e86a8eb221fffa07bd14befd55df142815e", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "_shasum": "d6de10d5af6132d5bd692427d46fc538539094c7", "_spec": "agent-base@2", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent", "author": { @@ -27,7 +27,6 @@ "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, - "bin": null, "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, @@ -39,7 +38,8 @@ "deprecated": false, "description": "Turn a function into an `http.Agent` instance", "devDependencies": { - "mocha": "2" + "mocha": "2", + "ws": "0.8.0" }, "homepage": "https://github.com/TooTallNate/node-agent-base#readme", "keywords": [ @@ -52,8 +52,6 @@ "license": "MIT", "main": "agent.js", "name": "agent-base", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" @@ -61,5 +59,5 @@ "scripts": { "test": "mocha --reporter spec" }, - "version": "2.0.1" + "version": "2.1.1" } diff --git a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js index f87d308f8..7d8dee66c 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js +++ b/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js @@ -9,13 +9,45 @@ var net = require('net'); var tls = require('tls'); var http = require('http'); var https = require('https'); +var WebSocket = require('ws'); var assert = require('assert'); var events = require('events'); +var inherits = require('util').inherits; +var semver = require('semver'); var Agent = require('../'); describe('Agent', function () { + describe('subclass', function () { + it('should be subclassable', function (done) { + function MyAgent () { + Agent.call(this); + } + inherits(MyAgent, Agent); + + MyAgent.prototype.callback = function (req, opts, fn) { + assert.equal(req.path, '/foo'); + assert.equal(req.getHeader('host'), '127.0.0.1:1234'); + assert.equal(opts.secureEndpoint, true); + done(); + }; + + var info = url.parse('https://127.0.0.1:1234/foo'); + info.agent = new MyAgent; + https.get(info); + }); + }); describe('"error" event', function () { - it('should be invoked on `http.ClientRequest` instance if passed to callback function on the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function (done) { + var agent = new Agent(); + var info = url.parse('http://127.0.0.1/foo'); + info.agent = agent; + var req = http.get(info); + req.on('error', function (err) { + assert.equal('"agent-base" has no default implementation, you must subclass and override `callback()`', err.message); + done(); + }); + }); + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { fn(new Error('is this caught?')); }); @@ -27,7 +59,7 @@ describe('Agent', function () { done(); }); }); - it('should be invoked on `http.ClientRequest` instance if passed to callback function after the first tick', function (done) { + it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function (done) { var agent = new Agent(function (req, opts, fn) { setTimeout(function () { fn(new Error('is this caught?')); @@ -54,6 +86,10 @@ describe('Agent', function () { done(); }; + // needed for `http` module in Node.js 4 + stream.cork = function () { + }; + var opts = { method: 'GET', host: '127.0.0.1', @@ -298,3 +334,118 @@ describe('"https" module', function () { }); }); }); + +describe('"ws" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + server = http.createServer() + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for basic WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = net.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('ws://127.0.0.1:' + port + '/', { + agent: agent + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); + +describe('"wss" server', function () { + var wss; + var server; + var port; + + // setup test HTTP server + before(function (done) { + var options = { + key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), + cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') + }; + server = https.createServer(options); + wss = new WebSocket.Server({ server: server }); + server.listen(0, function () { + port = server.address().port; + done(); + }); + }); + + // shut down test HTTP server + after(function (done) { + server.once('close', function () { + done(); + }); + server.close(); + }); + + it('should work for secure WebSocket connections', function (done) { + function onconnection(ws) { + ws.on('message', function (data) { + assert.equal('ping', data); + ws.send('pong'); + }); + } + wss.on('connection', onconnection); + + var agent = new Agent(function (req, opts, fn) { + var socket = tls.connect(opts); + fn(null, socket); + }); + + var client = new WebSocket('wss://127.0.0.1:' + port + '/', { + agent: agent, + rejectUnauthorized: false + }); + + client.on('open', function () { + client.send('ping'); + }); + + client.on('message', function (data) { + assert.equal('pong', data); + client.close(); + wss.removeListener('connection', onconnection); + done(); + }); + }); + +}); diff --git a/node_modules/pacote/node_modules/make-fetch-happen/package.json b/node_modules/pacote/node_modules/make-fetch-happen/package.json index 8b8e2cd87..ced08a608 100644 --- a/node_modules/pacote/node_modules/make-fetch-happen/package.json +++ b/node_modules/pacote/node_modules/make-fetch-happen/package.json @@ -1,8 +1,8 @@ { - "_from": "make-fetch-happen@^2.4.9", - "_id": "make-fetch-happen@2.4.9", + "_from": "make-fetch-happen@^2.4.10", + "_id": "make-fetch-happen@2.4.10", "_inBundle": false, - "_integrity": "sha512-/qh6T1E2gBD31bhutxeFehcHDwbBJJ7F+7w8bNAzPbacqfTwEpeo7W5SVQqciCSfNex51SjnEyw1XuK4zDn+Fw==", + "_integrity": "sha512-ZD9SRSC0TGlThOnnlPdDuUcKE74D8XeriPoNYEtWgBGAzKp4P7tIDWN6LvLvMSkd23HDbaUMsu9g3dO3NavZIg==", "_location": "/pacote/make-fetch-happen", "_phantomChildren": { "safe-buffer": "5.0.1" @@ -10,19 +10,19 @@ "_requested": { "type": "range", "registry": true, - "raw": "make-fetch-happen@^2.4.9", + "raw": "make-fetch-happen@^2.4.10", "name": "make-fetch-happen", "escapedName": "make-fetch-happen", - "rawSpec": "^2.4.9", + "rawSpec": "^2.4.10", "saveSpec": null, - "fetchSpec": "^2.4.9" + "fetchSpec": "^2.4.10" }, "_requiredBy": [ "/pacote" ], - "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-2.4.9.tgz", - "_shasum": "245b799e35da3ec05a45e6ef31f9c34df7d1e0c1", - "_spec": "make-fetch-happen@^2.4.9", + "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-2.4.10.tgz", + "_shasum": "5e52244a4cd80be925f5c8118a38ad0c2ceb4a81", + "_spec": "make-fetch-happen@^2.4.10", "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote", "author": { "name": "Kat Marchán", @@ -34,7 +34,7 @@ "bundleDependencies": false, "dependencies": { "agentkeepalive": "^3.1.0", - "cacache": "^9.2.4", + "cacache": "^9.2.6", "http-cache-semantics": "^3.7.3", "http-proxy-agent": "^1.0.0", "https-proxy-agent": "^1.0.0", @@ -42,8 +42,8 @@ "mississippi": "^1.2.0", "node-fetch-npm": "^2.0.1", "promise-retry": "^1.1.1", - "socks-proxy-agent": "^2.0.0", - "ssri": "^4.1.3" + "socks-proxy-agent": "^2.1.0", + "ssri": "^4.1.4" }, "deprecated": false, "description": "Opinionated, caching, retrying fetch client", @@ -92,5 +92,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "2.4.9" + "version": "2.4.10" } diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index c27683d0d..2f7614566 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,11 +1,11 @@ { - "_from": "pacote@2.7.21", - "_id": "pacote@2.7.21", + "_from": "pacote@2.7.24", + "_id": "pacote@2.7.24", "_inBundle": false, - "_integrity": "sha512-ksTHJiAkJxLmcOGxO6iGMk1cVMTTtIC051ZUqvWbckICIhzScOSBgGRBc4CHRhd62NuqAL082RuOOmb1Mi6o6Q==", + "_integrity": "sha512-ZUyifBqBzZ5FQU0zemQmwD4BfNT04H+4ljsP+MqKTt0lEI9Jbm/MQYrHJH5MG6pmv68ZvsbmaIG4G07rSrldxA==", "_location": "/pacote", "_phantomChildren": { - "cacache": "9.2.5", + "cacache": "9.2.6", "chownr": "1.0.1", "lru-cache": "4.0.2", "mississippi": "1.3.0", @@ -16,25 +16,25 @@ "retry": "0.10.1", "safe-buffer": "5.0.1", "semver": "5.3.0", - "ssri": "4.1.3" + "ssri": "4.1.4" }, "_requested": { "type": "version", "registry": true, - "raw": "pacote@2.7.21", + "raw": "pacote@2.7.24", "name": "pacote", "escapedName": "pacote", - "rawSpec": "2.7.21", + "rawSpec": "2.7.24", "saveSpec": null, - "fetchSpec": "2.7.21" + "fetchSpec": "2.7.24" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.21.tgz", - "_shasum": "e909e8a0559940053300e1127297e92a1302d244", - "_spec": "pacote@2.7.21", + "_resolved": "https://registry.npmjs.org/pacote/-/pacote-2.7.24.tgz", + "_shasum": "a817c8b6a070e99d47b1e05fc92e9fa4d5057905", + "_spec": "pacote@2.7.24", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", @@ -56,10 +56,10 @@ ], "dependencies": { "bluebird": "^3.5.0", - "cacache": "^9.2.5", + "cacache": "^9.2.6", "glob": "^7.1.2", "lru-cache": "^4.0.2", - "make-fetch-happen": "^2.4.9", + "make-fetch-happen": "^2.4.10", "minimatch": "^3.0.4", "mississippi": "^1.2.0", "normalize-package-data": "^2.3.6", @@ -71,7 +71,7 @@ "protoduck": "^4.0.0", "safe-buffer": "^5.0.1", "semver": "^5.3.0", - "ssri": "^4.1.3", + "ssri": "^4.1.4", "tar-fs": "^1.15.1", "tar-stream": "^1.5.4", "unique-filename": "^1.1.0", @@ -120,5 +120,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "2.7.21" + "version": "2.7.24" } diff --git a/node_modules/ssri/CHANGELOG.md b/node_modules/ssri/CHANGELOG.md index 46a0093e0..2d3341c92 100644 --- a/node_modules/ssri/CHANGELOG.md +++ b/node_modules/ssri/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [4.1.4](https://github.com/zkat/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) + + +### Bug Fixes + +* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/zkat/ssri/commit/513df4e)) + + + ## [4.1.3](https://github.com/zkat/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) diff --git a/node_modules/ssri/index.js b/node_modules/ssri/index.js index f01986fa5..3367eff9b 100644 --- a/node_modules/ssri/index.js +++ b/node_modules/ssri/index.js @@ -1,5 +1,7 @@ 'use strict' +const Buffer = require('safe-buffer').Buffer + const crypto = require('crypto') const Transform = require('stream').Transform @@ -31,7 +33,7 @@ class Hash { this.options = rawOpts ? rawOpts.slice(1).split('?') : [] } hexDigest () { - return this.digest && bufFrom(this.digest, 'base64').toString('hex') + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') } toJSON () { return this.toString() @@ -154,7 +156,7 @@ function fromHex (hexDigest, algorithm, opts) { : '' return parse( `${algorithm}-${ - bufFrom(hexDigest, 'hex').toString('base64') + Buffer.from(hexDigest, 'hex').toString('base64') }${optString}`, opts ) } @@ -332,7 +334,3 @@ function getPrioritizedHash (algo1, algo2) { ? algo1 : algo2 } - -function bufFrom (data, enc) { - return Buffer.from ? Buffer.from(data, enc) : new Buffer(data, enc) -} diff --git a/node_modules/ssri/package.json b/node_modules/ssri/package.json index fae62d7c5..58b463850 100644 --- a/node_modules/ssri/package.json +++ b/node_modules/ssri/package.json @@ -1,19 +1,19 @@ { - "_from": "ssri@4.1.3", - "_id": "ssri@4.1.3", + "_from": "ssri@4.1.4", + "_id": "ssri@4.1.4", "_inBundle": false, - "_integrity": "sha512-vDXK4C5lxEMlMXyUvsaNAqyYkoMaScW8r6jUTg3uwUOMnvbMmNRSw3Cal0iiWHtMsQxga7NG4GShS0CKt3Pt1w==", + "_integrity": "sha512-CfN7rEZZi9/eLoED+vfKpgEPXdev5D5FV2fCih8j1e+rOSrKwoXzq3HVGy5ybu5mj94lrQ1X2oP+xBjLNtPUQQ==", "_location": "/ssri", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "ssri@4.1.3", + "raw": "ssri@4.1.4", "name": "ssri", "escapedName": "ssri", - "rawSpec": "4.1.3", + "rawSpec": "4.1.4", "saveSpec": null, - "fetchSpec": "4.1.3" + "fetchSpec": "4.1.4" }, "_requiredBy": [ "#USER", @@ -23,9 +23,9 @@ "/pacote", "/pacote/make-fetch-happen" ], - "_resolved": "https://registry.npmjs.org/ssri/-/ssri-4.1.3.tgz", - "_shasum": "ec8b5585cbfc726a5f9aad829efce238de831935", - "_spec": "ssri@4.1.3", + "_resolved": "https://registry.npmjs.org/ssri/-/ssri-4.1.4.tgz", + "_shasum": "22be0659c075a612b622158872b585d5fe6b03af", + "_spec": "ssri@4.1.4", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Kat Marchán", @@ -43,7 +43,9 @@ ] } }, - "dependencies": {}, + "dependencies": { + "safe-buffer": "^5.0.1" + }, "deprecated": false, "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", "devDependencies": { @@ -88,5 +90,5 @@ "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "4.1.3" + "version": "4.1.4" } -- cgit v1.2.3