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

intervene

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intervene - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

CHANGELOG.md

1

dist/integration-tests/sampleServer.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createServer = void 0;
var hapi_1 = require("@hapi/hapi");

@@ -4,0 +5,0 @@ var joi = require("joi");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.untrustCertificate = exports.trustCertificate = exports.stopPortProxy = exports.getPortProxies = exports.portProxy = exports.removeHostEntry = exports.addHostEntry = void 0;
exports.addHostEntry = jest.fn(function () {

@@ -4,0 +5,0 @@ return Promise.resolve({ success: true, added: true });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeCleanup = exports.registerCleanup = void 0;
exports.registerCleanup = jest.fn();
exports.removeCleanup = jest.fn;
//# sourceMappingURL=cleanupQueue.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolve4 = void 0;
exports.resolve4 = jest.fn();
//# sourceMappingURL=dns.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCertPath = void 0;
function getCertPath() {

@@ -4,0 +5,0 @@ return Promise.resolve('/home/user/.dev-ssl-certs');

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getProxyResponse = void 0;
var httpRequest_1 = require("./../httpRequest");

@@ -41,0 +42,0 @@ var getProxyResponse = jest.fn(function getProxyResponse(proxyConfig, targetUrl, request) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pki = void 0;
exports.pki = {

@@ -4,0 +5,0 @@ certificateFromPem: jest.fn()

@@ -70,2 +70,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.stopPortProxy = exports.getPortProxies = exports.portProxy = exports.untrustCertificate = exports.trustCertificate = exports.removeHostEntry = exports.addHostEntry = void 0;
var axios_1 = require("axios");

@@ -72,0 +73,0 @@ var Bluebird = require("bluebird");

@@ -14,2 +14,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.applyConfigDefaults = void 0;
var url = require("url");

@@ -16,0 +17,0 @@ var configDefaults = {

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.runCleanups = exports.removeAllCleanups = exports.removeCleanup = exports.registerCleanup = void 0;
var logger_1 = require("./logger");

@@ -41,0 +42,0 @@ var cleanups = [];

2

dist/src/commands/admin.d.ts
import { Argv } from 'yargs';
declare const command = "admin [port]";
declare const describe = false;
declare const builder: (y: Argv<{}>) => Argv<{}>;
declare const builder: (y: Argv) => Argv;
declare const handler: (options: any) => Promise<void>;
export { command, describe, builder, handler };

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.builder = exports.describe = exports.command = void 0;
var adminServer_1 = require("../adminServer");

@@ -41,0 +42,0 @@ var logger_1 = require("../logger");

import { Argv } from 'yargs';
declare const command = "create [target]";
declare const describe = "Create a proxy for target";
declare const builder: (y: Argv<{}>) => Argv<Options>;
declare const builder: (y: Argv) => Argv<Options>;
interface Options {

@@ -6,0 +6,0 @@ target: string;

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.builder = exports.describe = exports.command = void 0;
var fs = require("fs");

@@ -41,0 +42,0 @@ var path = require("path");

import { Argv } from 'yargs';
declare const command = "generate-cert [hostname]";
declare const describe = "Generate a self signed certificate for a domain";
declare const builder: (y: Argv<{}>) => Argv<{}>;
declare const builder: (y: Argv) => Argv;
declare const handler: (argv: any) => void;
export { command, handler, describe, builder };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.builder = exports.describe = exports.handler = exports.command = void 0;
var createCert_1 = require("../createCert");

@@ -4,0 +5,0 @@ var promiseFs_1 = require("../promiseFs");

import { Argv } from 'yargs';
declare const command = "start [configFilename]";
declare const describe = "Start a proxy using the given config filename";
declare const builder: (y: Argv<{}>) => Argv<{}>;
declare const builder: (y: Argv) => Argv;
declare const handler: (options: any) => Promise<void>;
export { command, describe, builder, handler };

@@ -55,2 +55,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.builder = exports.describe = exports.command = void 0;
var applyConfigDefaults_1 = require("../applyConfigDefaults");

@@ -57,0 +58,0 @@ var childProcess = require("child_process");

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceImport = exports.loadConfig = void 0;
var axios_1 = require("axios");

@@ -41,0 +42,0 @@ var logger_1 = require("./logger");

@@ -66,2 +66,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createProxy = void 0;
var adminRequests_1 = require("./adminRequests");

@@ -181,3 +182,7 @@ var cleanupQueue_1 = require("./cleanupQueue");

if (tags.error) {
logger_1.log.error("Server error: " + (event.error ? event.error.message : 'unknown'));
var message = event.error ? event.error.message : 'unknown';
if (message.includes('alert bad certificate')) {
message = message + "\n intervene attempts to trust the certificate with the operating system when supported.\n This works for some browsers but not all (e.g. Firefox).\n\n For Firefox, open the requested URL in your browser and add a security exception for the certificate.\n \n For Chrome on Linux, make sure you have certutil available - package libnss3-tools under Debian based distributions\n (e.g. Ubuntu) and restart intervene.\n \n For other browsers or operating systems, refer to your browser or tool documentation about accessing URLs with untrusted certificates.\n ";
}
logger_1.log.error("Server error: " + message);
}

@@ -184,0 +189,0 @@ else {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.delay = void 0;
/**

@@ -4,0 +5,0 @@ * Delays the response (or handler) by the given number of milliseconds

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.clearDnsCache = exports.getIPForHost = void 0;
var Bluebird = require("bluebird");

@@ -41,0 +42,0 @@ var dns = require("dns");

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.clearLocalCertCache = exports.preloadCertForHost = exports.getCertForHost = void 0;
var adminRequests_1 = require("./adminRequests");

@@ -41,0 +42,0 @@ var Bluebird = require("bluebird");

@@ -39,2 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getCertPath = exports.setCertPath = void 0;
var path = require("path");

@@ -41,0 +42,0 @@ var promiseFs_1 = require("./promiseFs");

@@ -50,2 +50,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getProxyResponse = void 0;
var url = require("url");

@@ -52,0 +53,0 @@ var dnsLookup_1 = require("./dnsLookup");

@@ -30,2 +30,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpResponse = exports.httpRequest = void 0;
var http = require("http");

@@ -178,3 +179,3 @@ var https = require("https");

},
enumerable: true,
enumerable: false,
configurable: true

@@ -190,3 +191,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -202,3 +203,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -205,0 +206,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IncomingRequest = void 0;
var IncomingRequest = /** @class */ (function () {

@@ -29,3 +30,3 @@ function IncomingRequest(options) {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -41,3 +42,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -53,3 +54,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -56,0 +57,0 @@ });

@@ -6,9 +6,9 @@ "use strict";

var ProxyConfig_1 = require("./ProxyConfig");
exports.routeBuilder = ProxyConfig_1.routeBuilder;
Object.defineProperty(exports, "routeBuilder", { enumerable: true, get: function () { return ProxyConfig_1.routeBuilder; } });
var logger_1 = require("./logger");
exports.log = logger_1.log;
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return logger_1.log; } });
var httpRequest_1 = require("./httpRequest");
exports.httpRequest = httpRequest_1.httpRequest;
Object.defineProperty(exports, "httpRequest", { enumerable: true, get: function () { return httpRequest_1.httpRequest; } });
var delay_1 = require("./delay");
exports.delay = delay_1.delay;
Object.defineProperty(exports, "delay", { enumerable: true, get: function () { return delay_1.delay; } });
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTLSListener = void 0;
var getCertForHost_1 = require("./getCertForHost");

@@ -4,0 +5,0 @@ var https = require("https");

@@ -14,2 +14,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.log = exports.clearLoggers = exports.useLogger = exports.expandTags = void 0;
var events = require("events");

@@ -16,0 +17,0 @@ var allEvents = new events.EventEmitter();

@@ -23,2 +23,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.parseTypescript = void 0;
var fs = require("fs");

@@ -25,0 +26,0 @@ var ts = require("typescript");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.routeBuilder = void 0;
function routeBuilder(response) {

@@ -4,0 +5,0 @@ return response;

{
"name": "intervene",
"version": "3.0.1",
"version": "3.1.0",
"main": "dist/src/index.js",

@@ -15,3 +15,4 @@ "types": "dist/src/index.d.ts",

"unit-test": "jest src",
"integration-test": "jest integration-tests"
"integration-test": "jest integration-tests",
"semantic-release": "semantic-release"
},

@@ -49,2 +50,4 @@ "files": [

"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^24.0.13",

@@ -57,2 +60,3 @@ "http-server": "^0.12.3",

"prettier": "^1.14.3",
"semantic-release": "^17.4.3",
"sinon": "^6.3.4",

@@ -59,0 +63,0 @@ "unexpected": "^10.17.2",

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

![Build status](https://api.cirrus-ci.com/github/soundcloud/intervene.svg)
![node.js 12](https://api.cirrus-ci.com/github/soundcloud/intervene.svg?task=test_node12) ![node.js 14](https://api.cirrus-ci.com/github/soundcloud/intervene.svg?task=test_node14)
[![Node.js CI](https://github.com/soundcloud/intervene/actions/workflows/run-tests.yml/badge.svg)](https://github.com/soundcloud/intervene/actions/workflows/run-tests.yml)

@@ -4,0 +3,0 @@ ![npm version](https://img.shields.io/npm/v/intervene)

@@ -137,7 +137,17 @@ import { ProxyConfigWithDefaults } from './applyConfigDefaults';

if (tags.error) {
log.error(
`Server error: ${
event.error ? (event.error as any).message : 'unknown'
}`
);
let message = event.error ? (event.error as any).message : 'unknown';
if (message.includes('alert bad certificate')) {
message = `${message}
intervene attempts to trust the certificate with the operating system when supported.
This works for some browsers but not all (e.g. Firefox).
For Firefox, open the requested URL in your browser and add a security exception for the certificate.
For Chrome on Linux, make sure you have certutil available - package libnss3-tools under Debian based distributions
(e.g. Ubuntu) and restart intervene.
For other browsers or operating systems, refer to your browser or tool documentation about accessing URLs with untrusted certificates.
`;
}
log.error(`Server error: ${message}`);
} else {

@@ -144,0 +154,0 @@ log.error((event.error as any).message);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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