aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/config
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/config')
-rw-r--r--deps/npm/lib/config/pacote.js8
-rw-r--r--deps/npm/lib/config/reg-client.js29
2 files changed, 37 insertions, 0 deletions
diff --git a/deps/npm/lib/config/pacote.js b/deps/npm/lib/config/pacote.js
index 705544fe3c..2d2dda59fa 100644
--- a/deps/npm/lib/config/pacote.js
+++ b/deps/npm/lib/config/pacote.js
@@ -2,6 +2,7 @@
const Buffer = require('safe-buffer').Buffer
+const crypto = require('crypto')
const npm = require('../npm')
const log = require('npmlog')
let pack
@@ -9,6 +10,9 @@ const path = require('path')
let effectiveOwner
+const npmSession = crypto.randomBytes(8).toString('hex')
+log.verbose('npm-session', npmSession)
+
module.exports = pacoteOpts
function pacoteOpts (moreOpts) {
if (!pack) {
@@ -17,13 +21,17 @@ function pacoteOpts (moreOpts) {
const ownerStats = calculateOwner()
const opts = {
cache: path.join(npm.config.get('cache'), '_cacache'),
+ ca: npm.config.get('ca'),
+ cert: npm.config.get('cert'),
defaultTag: npm.config.get('tag'),
dirPacker: pack.packGitDep,
hashAlgorithm: 'sha1',
+ key: npm.config.get('key'),
localAddress: npm.config.get('local-address'),
log: log,
maxAge: npm.config.get('cache-min'),
maxSockets: npm.config.get('maxsockets'),
+ npmSession: npmSession,
offline: npm.config.get('offline'),
preferOffline: npm.config.get('prefer-offline') || npm.config.get('cache-min') > 9999,
preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0,
diff --git a/deps/npm/lib/config/reg-client.js b/deps/npm/lib/config/reg-client.js
new file mode 100644
index 0000000000..d4e2417097
--- /dev/null
+++ b/deps/npm/lib/config/reg-client.js
@@ -0,0 +1,29 @@
+'use strict'
+
+module.exports = regClientConfig
+function regClientConfig (npm, log, config) {
+ return {
+ proxy: {
+ http: config.get('proxy'),
+ https: config.get('https-proxy'),
+ localAddress: config.get('local-address')
+ },
+ ssl: {
+ certificate: config.get('cert'),
+ key: config.get('key'),
+ ca: config.get('ca'),
+ strict: config.get('strict-ssl')
+ },
+ retry: {
+ retries: config.get('fetch-retries'),
+ factor: config.get('fetch-retry-factor'),
+ minTimeout: config.get('fetch-retry-mintimeout'),
+ maxTimeout: config.get('fetch-retry-maxtimeout')
+ },
+ userAgent: config.get('user-agent'),
+ log: log,
+ defaultTag: config.get('tag'),
+ maxSockets: config.get('maxsockets'),
+ scope: npm.projectScope
+ }
+}