Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2019-07-17 01:30:14 +0300
committerisaacs <i@izs.me>2019-07-17 02:28:49 +0300
commit554b641d49d135ae8d137e83aa288897c32dacc6 (patch)
tree93eb750355e722ed98d585f5fd1626e68e32bfa0 /node_modules/https-proxy-agent
parente95da463cb7a325457ef411a569d7ef4bf76901d (diff)
dedupe: npm-registry-fetch@4.0.0
Diffstat (limited to 'node_modules/https-proxy-agent')
-rw-r--r--node_modules/https-proxy-agent/.travis.yml22
-rw-r--r--node_modules/https-proxy-agent/index.d.ts22
-rw-r--r--node_modules/https-proxy-agent/package.json19
-rw-r--r--node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key15
-rw-r--r--node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem12
-rw-r--r--node_modules/https-proxy-agent/test/test.js342
6 files changed, 31 insertions, 401 deletions
diff --git a/node_modules/https-proxy-agent/.travis.yml b/node_modules/https-proxy-agent/.travis.yml
deleted file mode 100644
index 805d3d50d..000000000
--- a/node_modules/https-proxy-agent/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-sudo: false
-
-language: node_js
-
-node_js:
- - "4"
- - "5"
- - "6"
- - "7"
- - "8"
-
-install:
- - PATH="`npm bin`:`npm bin -g`:$PATH"
- # 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/https-proxy-agent/index.d.ts b/node_modules/https-proxy-agent/index.d.ts
new file mode 100644
index 000000000..7b9e2b16d
--- /dev/null
+++ b/node_modules/https-proxy-agent/index.d.ts
@@ -0,0 +1,22 @@
+declare module 'https-proxy-agent' {
+ import * as https from 'https'
+
+ namespace HttpsProxyAgent {
+ interface HttpsProxyAgentOptions {
+ host: string
+ port: number
+ secureProxy?: boolean
+ headers?: {
+ [key: string]: string
+ }
+ [key: string]: any
+ }
+ }
+
+ // HttpsProxyAgent doesnt *actually* extend https.Agent, but for my purposes I want it to pretend that it does
+ class HttpsProxyAgent extends https.Agent {
+ constructor(opts: HttpsProxyAgent.HttpsProxyAgentOptions | string)
+ }
+
+ export = HttpsProxyAgent
+}
diff --git a/node_modules/https-proxy-agent/package.json b/node_modules/https-proxy-agent/package.json
index 538782a86..1f2885918 100644
--- a/node_modules/https-proxy-agent/package.json
+++ b/node_modules/https-proxy-agent/package.json
@@ -1,8 +1,8 @@
{
"_from": "https-proxy-agent@^2.2.1",
- "_id": "https-proxy-agent@2.2.1",
+ "_id": "https-proxy-agent@2.2.2",
"_inBundle": false,
- "_integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
+ "_integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
"_location": "/https-proxy-agent",
"_phantomChildren": {},
"_requested": {
@@ -16,14 +16,12 @@
"fetchSpec": "^2.2.1"
},
"_requiredBy": [
- "/make-fetch-happen",
- "/npm-profile/make-fetch-happen",
- "/npm-registry-fetch/make-fetch-happen"
+ "/make-fetch-happen"
],
- "_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
- "_shasum": "51552970fa04d723e04c56d04178c3f92592bbc0",
+ "_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
+ "_shasum": "271ea8e90f836ac9f119daccd39c19ff7dfb0793",
"_spec": "https-proxy-agent@^2.2.1",
- "_where": "/Users/rebecca/code/npm/node_modules/make-fetch-happen",
+ "_where": "/Users/isaacs/dev/npm/cli/node_modules/make-fetch-happen",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
@@ -34,7 +32,7 @@
},
"bundleDependencies": false,
"dependencies": {
- "agent-base": "^4.1.0",
+ "agent-base": "^4.3.0",
"debug": "^3.1.0"
},
"deprecated": false,
@@ -63,5 +61,6 @@
"scripts": {
"test": "mocha --reporter spec"
},
- "version": "2.2.1"
+ "types": "./index.d.ts",
+ "version": "2.2.2"
}
diff --git a/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key b/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key
deleted file mode 100644
index fd1250122..000000000
--- a/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr
-bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y
-b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB
-AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd
-Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x
-1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ
-5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW
-T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX
-uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N
-Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw
-h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J
-bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ
-ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg==
------END RSA PRIVATE KEY-----
diff --git a/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem b/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem
deleted file mode 100644
index b115a5e91..000000000
--- a/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem
+++ /dev/null
@@ -1,12 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3
-NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0
-NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3
-NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
-ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay
-OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn
-g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN
-AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4
-1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J
-QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI=
------END CERTIFICATE-----
diff --git a/node_modules/https-proxy-agent/test/test.js b/node_modules/https-proxy-agent/test/test.js
deleted file mode 100644
index b36849582..000000000
--- a/node_modules/https-proxy-agent/test/test.js
+++ /dev/null
@@ -1,342 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var fs = require('fs');
-var url = require('url');
-var http = require('http');
-var https = require('https');
-var assert = require('assert');
-var Proxy = require('proxy');
-var HttpsProxyAgent = require('../');
-
-describe('HttpsProxyAgent', function () {
-
- var server;
- var serverPort;
-
- var sslServer;
- var sslServerPort;
-
- var proxy;
- var proxyPort;
-
- var sslProxy;
- var sslProxyPort;
-
- before(function (done) {
- // setup target HTTP server
- server = http.createServer();
- server.listen(function () {
- serverPort = server.address().port;
- done();
- });
- });
-
- before(function (done) {
- // setup HTTP proxy server
- proxy = Proxy();
- proxy.listen(function () {
- proxyPort = proxy.address().port;
- done();
- });
- });
-
- before(function (done) {
- // setup target HTTPS server
- var options = {
- key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'),
- cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem')
- };
- sslServer = https.createServer(options);
- sslServer.listen(function () {
- sslServerPort = sslServer.address().port;
- done();
- });
- });
-
- before(function (done) {
- // setup SSL HTTP proxy server
- var options = {
- key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'),
- cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem')
- };
- sslProxy = Proxy(https.createServer(options));
- sslProxy.listen(function () {
- sslProxyPort = sslProxy.address().port;
- done();
- });
- });
-
- // shut down test HTTP server
- after(function (done) {
- server.once('close', function () { done(); });
- server.close();
- });
-
- after(function (done) {
- proxy.once('close', function () { done(); });
- proxy.close();
- });
-
- after(function (done) {
- sslServer.once('close', function () { done(); });
- sslServer.close();
- });
-
- after(function (done) {
- sslProxy.once('close', function () { done(); });
- sslProxy.close();
- });
-
- describe('constructor', function () {
- it('should throw an Error if no "proxy" argument is given', function () {
- assert.throws(function () {
- new HttpsProxyAgent();
- });
- });
- it('should accept a "string" proxy argument', function () {
- var agent = new HttpsProxyAgent('http://127.0.0.1:' + proxyPort);
- assert.equal('127.0.0.1', agent.proxy.host);
- assert.equal(proxyPort, agent.proxy.port);
- });
- it('should accept a `url.parse()` result object argument', function () {
- var opts = url.parse('http://127.0.0.1:' + proxyPort);
- var agent = new HttpsProxyAgent(opts);
- assert.equal('127.0.0.1', agent.proxy.host);
- assert.equal(proxyPort, agent.proxy.port);
- });
- it('should set a `defaultPort` property', function () {
- var opts = url.parse("http://127.0.0.1:" + proxyPort);
- var agent = new HttpsProxyAgent(opts);
- assert.equal(443, agent.defaultPort);
- });
- describe('secureProxy', function () {
- it('should default to `false`', function () {
- var agent = new HttpsProxyAgent({ port: proxyPort });
- assert.equal(false, agent.secureProxy);
- });
- it('should be `false` when "http:" protocol is used', function () {
- var agent = new HttpsProxyAgent({ port: proxyPort, protocol: 'http:' });
- assert.equal(false, agent.secureProxy);
- });
- it('should be `true` when "https:" protocol is used', function () {
- var agent = new HttpsProxyAgent({ port: proxyPort, protocol: 'https:' });
- assert.equal(true, agent.secureProxy);
- });
- it('should be `true` when "https" protocol is used', function () {
- var agent = new HttpsProxyAgent({ port: proxyPort, protocol: 'https' });
- assert.equal(true, agent.secureProxy);
- });
- });
- });
-
- describe('"http" module', function () {
-
- beforeEach(function () {
- delete proxy.authenticate;
- });
-
- it('should work over an HTTP proxy', function (done) {
- server.once('request', function (req, res) {
- res.end(JSON.stringify(req.headers));
- });
-
- var proxy = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort;
- var agent = new HttpsProxyAgent(proxy);
-
- var opts = url.parse('http://127.0.0.1:' + serverPort);
- opts.agent = agent;
-
- var req = http.get(opts, function (res) {
- var data = '';
- res.setEncoding('utf8');
- res.on('data', function (b) {
- data += b;
- });
- res.on('end', function () {
- data = JSON.parse(data);
- assert.equal('127.0.0.1:' + serverPort, data.host);
- done();
- });
- });
- req.once('error', done);
- });
- it('should work over an HTTPS proxy', function (done) {
- server.once('request', function (req, res) {
- res.end(JSON.stringify(req.headers));
- });
-
- var proxy = process.env.HTTPS_PROXY || process.env.https_proxy || 'https://127.0.0.1:' + sslProxyPort;
- proxy = url.parse(proxy);
- proxy.rejectUnauthorized = false;
- var agent = new HttpsProxyAgent(proxy);
-
- var opts = url.parse('http://127.0.0.1:' + serverPort);
- opts.agent = agent;
-
- http.get(opts, function (res) {
- var data = '';
- res.setEncoding('utf8');
- res.on('data', function (b) {
- data += b;
- });
- res.on('end', function () {
- data = JSON.parse(data);
- assert.equal('127.0.0.1:' + serverPort, data.host);
- done();
- });
- });
- });
- it('should receive the 407 authorization code on the `http.ClientResponse`', function (done) {
- // set a proxy authentication function for this test
- proxy.authenticate = function (req, fn) {
- // reject all requests
- fn(null, false);
- };
-
- var proxyUri = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort;
- var agent = new HttpsProxyAgent(proxyUri);
-
- var opts = {};
- // `host` and `port` don't really matter since the proxy will reject anyways
- opts.host = '127.0.0.1';
- opts.port = 80;
- opts.agent = agent;
-
- var req = http.get(opts, function (res) {
- assert.equal(407, res.statusCode);
- assert('proxy-authenticate' in res.headers);
- done();
- });
- });
- it('should emit an "error" event on the `http.ClientRequest` if the proxy does not exist', function (done) {
- // port 4 is a reserved, but "unassigned" port
- var proxyUri = 'http://127.0.0.1:4';
- var agent = new HttpsProxyAgent(proxyUri);
-
- var opts = url.parse('http://nodejs.org');
- opts.agent = agent;
-
- var req = http.get(opts);
- req.once('error', function (err) {
- assert.equal('ECONNREFUSED', err.code);
- req.abort();
- done();
- });
- });
-
- it('should allow custom proxy "headers"', function (done) {
- server.once('connect', function (req, socket, head) {
- assert.equal('CONNECT', req.method);
- assert.equal('bar', req.headers.foo);
- socket.destroy();
- done();
- });
-
- var uri = 'http://127.0.0.1:' + serverPort;
- var proxyOpts = url.parse(uri);
- proxyOpts.headers = {
- 'Foo': 'bar'
- };
- var agent = new HttpsProxyAgent(proxyOpts);
-
- var opts = {};
- // `host` and `port` don't really matter since the proxy will reject anyways
- opts.host = '127.0.0.1';
- opts.port = 80;
- opts.agent = agent;
-
- http.get(opts);
- });
-
- });
-
- describe('"https" module', function () {
- it('should work over an HTTP proxy', function (done) {
- sslServer.once('request', function (req, res) {
- res.end(JSON.stringify(req.headers));
- });
-
- var proxy = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort;
- var agent = new HttpsProxyAgent(proxy);
-
- var opts = url.parse('https://127.0.0.1:' + sslServerPort);
- opts.rejectUnauthorized = false;
- opts.agent = agent;
-
- https.get(opts, function (res) {
- var data = '';
- res.setEncoding('utf8');
- res.on('data', function (b) {
- data += b;
- });
- res.on('end', function () {
- data = JSON.parse(data);
- assert.equal('127.0.0.1:' + sslServerPort, data.host);
- done();
- });
- });
- });
-
- it('should work over an HTTPS proxy', function (done) {
- sslServer.once('request', function (req, res) {
- res.end(JSON.stringify(req.headers));
- });
-
- var proxy = process.env.HTTPS_PROXY || process.env.https_proxy || 'https://127.0.0.1:' + sslProxyPort;
- proxy = url.parse(proxy);
- proxy.rejectUnauthorized = false;
- var agent = new HttpsProxyAgent(proxy);
-
- var opts = url.parse('https://127.0.0.1:' + sslServerPort);
- opts.agent = agent;
- opts.rejectUnauthorized = false;
-
- https.get(opts, function (res) {
- var data = '';
- res.setEncoding('utf8');
- res.on('data', function (b) {
- data += b;
- });
- res.on('end', function () {
- data = JSON.parse(data);
- assert.equal('127.0.0.1:' + sslServerPort, data.host);
- done();
- });
- });
- });
-
- it('should not send a port number for the default port', function (done) {
- sslServer.once('request', function (req, res) {
- res.end(JSON.stringify(req.headers));
- });
-
- var proxy = process.env.HTTPS_PROXY || process.env.https_proxy || "https://127.0.0.1:" + sslProxyPort;
- proxy = url.parse(proxy);
- proxy.rejectUnauthorized = false;
- var agent = new HttpsProxyAgent(proxy);
- agent.defaultPort = sslServerPort;
-
- var opts = url.parse("https://127.0.0.1:" + sslServerPort);
- opts.agent = agent;
- opts.rejectUnauthorized = false;
-
- https.get(opts, function(res) {
- var data = "";
- res.setEncoding("utf8");
- res.on("data", function(b) {
- data += b;
- });
- res.on("end", function() {
- data = JSON.parse(data);
- assert.equal("127.0.0.1", data.host);
- done();
- });
- });
- });
-
- });
-
-});