You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@codefresh-io/cf-git-providers

Package Overview
Dependencies
Maintainers
30
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/cf-git-providers - npm Package Compare versions

Comparing version

to
0.4.4-CR-10173-3

26

lib/providers/github.js

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

const plugin_retry_1 = require("@octokit/plugin-retry");
const https_proxy_agent_1 = require("https-proxy-agent");
const proxy_agent_1 = __importDefault(require("proxy-agent"));
const lodash_1 = require("lodash");
const https_1 = require("https");
const url_1 = __importDefault(require("url"));
const helpers_1 = require("../helpers");

@@ -32,15 +31,2 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires

};
const _getAgent = (insecure) => {
const options = { keepAlive: true, maxSockets: 10, rejectUnauthorized: !insecure };
const proxyUrl = process.env.HTTPS_PROXY || process.env.https_proxy;
let agent;
if (proxyUrl) {
const proxy = url_1.default.parse(proxyUrl);
agent = new https_proxy_agent_1.HttpsProxyAgent({ ...options, ...proxy });
}
else {
agent = new https_1.Agent(options);
}
return agent;
};
const _cleanFilePath = (filepath) => {

@@ -132,3 +118,9 @@ const prefix = './';

const pathPrefix = (opt.apiPathPrefix && opt.apiPathPrefix !== '/') ? opt.apiPathPrefix : '';
const agent = _getAgent(process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' || lodash_1.get(opt, 'insecure', false));
const insecure = process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' || lodash_1.get(opt, 'insecure', false);
const baseUrl = `https://${opt.apiHost || 'api.github.com'}${pathPrefix}`;
const agentOptions = { keepAlive: true, maxSockets: 10, rejectUnauthorized: !insecure };
let agent = new https_1.Agent(agentOptions);
if (process.env.HTTP_PROXY || process.env.HTTPS_PROXY) {
agent = new proxy_agent_1.default();
}
const GithubClient = rest_1.Octokit.plugin(plugin_retry_1.retry);

@@ -146,3 +138,3 @@ this.githubClient = new GithubClient({

debug: true,
baseUrl: `https://${opt.apiHost || 'api.github.com'}${pathPrefix}`
baseUrl,
});

@@ -149,0 +141,0 @@ }

{
"name": "@codefresh-io/cf-git-providers",
"version": "0.4.4-CR-10173",
"version": "0.4.4-CR-10173-3",
"description": "An NPM module/CLI for interacting with various git providers",

@@ -23,3 +23,2 @@ "keywords": [

"debug": "^4.1.1",
"https-proxy-agent": "^5.0.0",
"lodash": "^4.17.21",

@@ -26,0 +25,0 @@ "p-limit": "^3.0.2",

Sorry, the diff of this file is not supported yet