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

@mongodb-js/devtools-proxy-support

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongodb-js/devtools-proxy-support - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

dist/system-ca.d.ts

2

dist/agent.d.ts

@@ -8,3 +8,3 @@ import type { Agent } from 'https';

import type { ProxyLogEmitter } from './logging';
import type { EventEmitter } from 'events';
import { EventEmitter } from 'events';
export type AgentWithInitialize = Agent & {

@@ -11,0 +11,0 @@ initialize?(): Promise<void>;

@@ -8,6 +8,11 @@ "use strict";

const ssh_1 = require("./ssh");
const events_1 = require("events");
const agent_base_1 = require("agent-base");
const system_ca_1 = require("./system-ca");
class DevtoolsProxyAgent extends proxy_agent_1.ProxyAgent {
constructor(proxyOptions) {
constructor(proxyOptions, logger) {
const { ca, ...proxyOptionsWithoutCA } = proxyOptions;
void ca;
super({
...proxyOptions,
...proxyOptionsWithoutCA,
getProxyForUrl: (url) => this._getProxyForUrl(url),

@@ -26,5 +31,6 @@ });

};
this.logger = logger;
this.proxyOptions = proxyOptions;
if (proxyOptions.proxy && new URL(proxyOptions.proxy).protocol === 'ssh:') {
this.sshAgent = new ssh_1.SSHAgent(proxyOptions);
this.sshAgent = new ssh_1.SSHAgent(proxyOptions, logger);
}

@@ -36,2 +42,3 @@ }

async connect(req, opts) {
opts.ca = (0, system_ca_1.mergeCA)(this.proxyOptions.ca, opts.ca);
if (this.sshAgent)

@@ -51,4 +58,27 @@ return this.sshAgent;

}
class DevtoolsProxyAgentWithSystemCA extends agent_base_1.Agent {
constructor(proxyOptions) {
super();
this.logger = new events_1.EventEmitter();
this.proxyOptions = proxyOptions;
this.agent = (async () => {
const { ca } = await (0, system_ca_1.systemCA)({ ca: proxyOptions.ca });
return new DevtoolsProxyAgent({ ...proxyOptions, ca }, this.logger);
})();
this.agent.catch(() => {
});
}
async initialize() {
const agent = await this.agent;
await agent.initialize?.();
}
async connect() {
return await this.agent;
}
async destroy() {
(await this.agent).destroy();
}
}
function createAgent(proxyOptions) {
return new DevtoolsProxyAgent(proxyOptions);
return new DevtoolsProxyAgentWithSystemCA(proxyOptions);
}

@@ -55,0 +85,0 @@ function useOrCreateAgent(proxyOptions, target) {

@@ -6,2 +6,3 @@ export { DevtoolsProxyOptions, DevtoolsProxyOptionsSecrets, translateToElectronProxyConfig, extractProxySecrets, mergeProxySecrets, } from './proxy-options';

export { ProxyEventMap, ProxyLogEmitter, hookLogger } from './logging';
export { systemCA, resetSystemCACache } from './system-ca';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hookLogger = exports.createFetch = exports.useOrCreateAgent = exports.createAgent = exports.createSocks5Tunnel = exports.mergeProxySecrets = exports.extractProxySecrets = exports.translateToElectronProxyConfig = void 0;
exports.resetSystemCACache = exports.systemCA = exports.hookLogger = exports.createFetch = exports.useOrCreateAgent = exports.createAgent = exports.createSocks5Tunnel = exports.mergeProxySecrets = exports.extractProxySecrets = exports.translateToElectronProxyConfig = void 0;
var proxy_options_1 = require("./proxy-options");

@@ -17,2 +17,5 @@ Object.defineProperty(exports, "translateToElectronProxyConfig", { enumerable: true, get: function () { return proxy_options_1.translateToElectronProxyConfig; } });

Object.defineProperty(exports, "hookLogger", { enumerable: true, get: function () { return logging_1.hookLogger; } });
var system_ca_1 = require("./system-ca");
Object.defineProperty(exports, "systemCA", { enumerable: true, get: function () { return system_ca_1.systemCA; } });
Object.defineProperty(exports, "resetSystemCACache", { enumerable: true, get: function () { return system_ca_1.resetSystemCACache; } });
//# sourceMappingURL=index.js.map

@@ -179,3 +179,3 @@ "use strict";

function mergeProxySecrets({ proxyOptions, secrets, }) {
const parsedSecrets = JSON.parse(secrets);
const parsedSecrets = JSON.parse(secrets || '{}');
if ((parsedSecrets.username || parsedSecrets.password) &&

@@ -182,0 +182,0 @@ proxyOptions.proxy) {

@@ -16,3 +16,3 @@ {

"homepage": "https://github.com/mongodb-js/devtools-shared",
"version": "0.2.0",
"version": "0.3.0",
"repository": {

@@ -54,3 +54,4 @@ "type": "git",

"socksv5": "^0.0.6",
"ssh2": "^1.15.0"
"ssh2": "^1.15.0",
"system-ca": "^2.0.0"
},

@@ -79,3 +80,3 @@ "devDependencies": {

},
"gitHead": "cb955eba7effce5aabd90f41119484f253fb1755"
"gitHead": "64b898106d63c9da98f49fe4d9748caad465bad6"
}

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