Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
535480e
deps: npm-registry-fetch@15.0.0
lukekarrys Aug 11, 2023
db176b7
chore: set workspaces with changing engines to prerelease
lukekarrys Aug 11, 2023
7b35813
fix: drop node14 support
lukekarrys Aug 11, 2023
95cee45
fix: drop node14 support
lukekarrys Aug 11, 2023
41f21a4
fix: drop node14 support
lukekarrys Aug 11, 2023
9033fe5
fix: drop node14 support
lukekarrys Aug 11, 2023
e230a08
fix: drop node14 support
lukekarrys Aug 11, 2023
7946827
fix: drop node14 support
lukekarrys Aug 11, 2023
ded745c
fix: drop node14 support
lukekarrys Aug 11, 2023
c8b5633
deps: pacote@16.0.0
lukekarrys Aug 11, 2023
e0ced9e
fix: drop node14 support
lukekarrys Aug 11, 2023
bee1a79
fix: drop node14 support
lukekarrys Aug 11, 2023
936d920
fix: drop node14 support
lukekarrys Aug 11, 2023
3d3f819
chore: drop node14 support in private mock-registry workspace
lukekarrys Aug 11, 2023
e25a066
chore: set workspaces with changing engines to prerelease
lukekarrys Aug 11, 2023
c528245
deps: npm-profile@8.0.0
lukekarrys Aug 14, 2023
57df8bb
deps: @npmcli/metavuln-calculator@6.0.0
lukekarrys Aug 14, 2023
028fa81
deps: cacache@17.1.4
lukekarrys Aug 14, 2023
39b4043
deps: fs-minipass@3.0.3
lukekarrys Aug 14, 2023
80844e9
deps: make-fetch-happen@12.0.0
lukekarrys Aug 14, 2023
5902b4b
deps: ssri@10.0.5
lukekarrys Aug 14, 2023
e1362b5
deps: npm-pick-manifest@8.0.2
lukekarrys Aug 14, 2023
f6deaf8
deps: npm-install-checks@6.2.0
lukekarrys Aug 14, 2023
959a463
deps: glob@10.3.3
lukekarrys Aug 14, 2023
72ffaa3
deps: minipass@7.0.3
lukekarrys Aug 14, 2023
b886c3b
deps: @npmcli/metavuln-calculator@6.0.1
lukekarrys Aug 14, 2023
2f8af55
deps: minipass-fetch@3.0.4
lukekarrys Aug 14, 2023
5d776c8
deps: @npmcli/git@5.0.0
lukekarrys Aug 15, 2023
9389a81
deps: @npmcli/package-json@5.0.0
lukekarrys Aug 15, 2023
4e0382e
deps: cacache@18.0.0
lukekarrys Aug 15, 2023
39d8732
deps: hosted-git-info@7.0.0
lukekarrys Aug 15, 2023
6d1987d
deps: make-fetch-happen@13.0.0
lukekarrys Aug 15, 2023
8e7381a
deps: normalize-package-data@6.0.0
lukekarrys Aug 15, 2023
eb3aa2c
deps: npm-package-arg@11.0.0
lukekarrys Aug 15, 2023
f166d99
deps: hoist lru-cache@10.0.1
lukekarrys Aug 15, 2023
c993bfc
deps: npm-pick-manifest@9.0.0
lukekarrys Aug 15, 2023
4b70fc0
deps: pacote@17.0.0
lukekarrys Aug 15, 2023
84925a0
deps: init-package-json@6.0.0
lukekarrys Aug 15, 2023
c13a01e
deps: @npmcli/git@5.0.1
lukekarrys Aug 15, 2023
6ba2fd3
deps: @npmcli/metavuln-calculator@7.0.0
lukekarrys Aug 15, 2023
d556787
chore: set workspaces with changing engines to prerelease
lukekarrys Aug 15, 2023
947c111
fix: drop node 16.13.x support
lukekarrys Aug 15, 2023
e6df998
deps: hoist normalize-package-data@6.0.0
lukekarrys Aug 15, 2023
a87de29
deps: hoist read-package-json@7.0.0
lukekarrys Aug 15, 2023
10a6be4
deps: pacote@17.0.1
lukekarrys Aug 15, 2023
228b224
deps: npm-registry-fetch@16.0.0
lukekarrys Aug 15, 2023
0e1fdff
deps: npm-profile@9.0.0
lukekarrys Aug 15, 2023
0815f9f
fix: set objectMode for search filter stream
lukekarrys Aug 16, 2023
d58b2fb
chore: update doctor snapshots for new proxy messages
lukekarrys Aug 16, 2023
37a28d0
chore: check git status after deps
lukekarrys Aug 16, 2023
e6c9c28
chore: tap@16.3.8
lukekarrys Aug 17, 2023
5bd0bfd
chore: nock@13.3.0
lukekarrys Aug 17, 2023
dd1a9f5
chore: audit fix for semver in nested dev deps
lukekarrys Aug 17, 2023
54a2535
deps: bump sigstore from 1.7.0 to 2.0.0
bdehamer Aug 18, 2023
16157b0
deps: pacote@17.0.2
lukekarrys Aug 18, 2023
bbbd3f1
deps: pacote@17.0.3
lukekarrys Aug 30, 2023
d712ed2
deps: npm-packlist@8.0.0
lukekarrys Aug 30, 2023
2f28245
deps: which@4.0.0
lukekarrys Aug 30, 2023
3858118
deps: @sigstore/tuf@2.1.0
lukekarrys Aug 30, 2023
b50d5df
deps: sigstore@2.1.0
lukekarrys Aug 30, 2023
8eb8fe8
deps: @npmcli/agent@2.1.0
lukekarrys Aug 30, 2023
3643999
deps: @npmcli/promise-spawn@7.0.0
lukekarrys Aug 30, 2023
eb4dc0f
deps: @npmcli/run-script@7.0.0
lukekarrys Aug 30, 2023
aa4164c
deps: pacote@17.0.4
lukekarrys Aug 30, 2023
520b7a0
deps: @npmcli/git@5.0.2
lukekarrys Aug 30, 2023
1394a21
deps: @npmcli/run-script@7.0.1
lukekarrys Aug 30, 2023
46812cc
deps: @npmcli/git@5.0.3
lukekarrys Aug 30, 2023
ecf0de4
chore: drop node14 support in private mock-globals workspace
lukekarrys Aug 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
deps: npm-registry-fetch@15.0.0
  • Loading branch information
lukekarrys committed Aug 11, 2023
commit 535480ebe6ef7ac3c081a1d6b0c9519404d70e58
11 changes: 11 additions & 0 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
!/@isaacs/string-locale-compare
!/@npmcli/
/@npmcli/*
!/@npmcli/agent
!/@npmcli/disparity-colors
!/@npmcli/fs
!/@npmcli/git
Expand Down Expand Up @@ -193,12 +194,22 @@
!/npm-packlist
!/npm-pick-manifest
!/npm-profile
!/npm-profile/node_modules/
/npm-profile/node_modules/*
!/npm-profile/node_modules/npm-registry-fetch
!/npm-registry-fetch
!/npm-registry-fetch/node_modules/
/npm-registry-fetch/node_modules/*
!/npm-registry-fetch/node_modules/make-fetch-happen
!/npm-registry-fetch/node_modules/minipass
!/npm-user-validate
!/npmlog
!/once
!/p-map
!/pacote
!/pacote/node_modules/
/pacote/node_modules/*
!/pacote/node_modules/npm-registry-fetch
!/parse-conflict-json
!/path-is-absolute
!/path-key
Expand Down
51 changes: 51 additions & 0 deletions node_modules/@npmcli/agent/lib/dns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict'

const LRUCache = require('lru-cache')
const dns = require('dns')

const defaultOptions = exports.defaultOptions = {
family: undefined,
hints: dns.ADDRCONFIG,
all: false,
verbatim: undefined,
}

const lookupCache = exports.lookupCache = new LRUCache({ max: 50 })

// this is a factory so that each request can have its own opts (i.e. ttl)
// while still sharing the cache across all requests
exports.getLookup = (dnsOptions) => {
return (hostname, options, callback) => {
if (typeof options === 'function') {
callback = options
options = null
} else if (typeof options === 'number') {
options = { family: options }
}

options = { ...defaultOptions, ...options }

const key = JSON.stringify({
hostname,
family: options.family,
hints: options.hints,
all: options.all,
verbatim: options.verbatim,
})

if (lookupCache.has(key)) {
const [address, family] = lookupCache.get(key)
process.nextTick(callback, null, address, family)
return
}

dnsOptions.lookup(hostname, options, (err, address, family) => {
if (err) {
return callback(err)
}

lookupCache.set(key, [address, family], { ttl: dnsOptions.ttl })
return callback(null, address, family)
})
}
}
71 changes: 71 additions & 0 deletions node_modules/@npmcli/agent/lib/errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
'use strict'

class InvalidProxyProtocolError extends Error {
constructor (url) {
super(`Invalid protocol \`${url.protocol}\` connecting to proxy \`${url.host}\``)
this.code = 'EINVALIDPROXY'
this.proxy = url
}
}

class InvalidProxyResponseError extends Error {
constructor (url, status) {
super(`Invalid status code \`${status}\` connecting to proxy \`${url.host}\``)
this.code = 'EINVALIDRESPONSE'
this.proxy = url
this.status = status
}
}

class ConnectionTimeoutError extends Error {
constructor (host) {
super(`Timeout connecting to host \`${host}\``)
this.code = 'ECONNECTIONTIMEOUT'
this.host = host
}
}

class IdleTimeoutError extends Error {
constructor (host) {
super(`Idle timeout reached for host \`${host}\``)
this.code = 'EIDLETIMEOUT'
this.host = host
}
}

class ResponseTimeoutError extends Error {
constructor (proxy, request) {
let msg = 'Response timeout '
if (proxy.url) {
msg += `from proxy \`${proxy.url.host}\` `
}
msg += `connecting to host \`${request.host}\``
super(msg)
this.code = 'ERESPONSETIMEOUT'
this.proxy = proxy.url
this.request = request
}
}

class TransferTimeoutError extends Error {
constructor (proxy, request) {
let msg = 'Transfer timeout '
if (proxy.url) {
msg += `from proxy \`${proxy.url.host}\` `
}
msg += `for \`${request.host}\``
super(msg)
this.code = 'ETRANSFERTIMEOUT'
this.proxy = proxy.url
this.request = request
}
}

module.exports = {
InvalidProxyProtocolError,
InvalidProxyResponseError,
ConnectionTimeoutError,
IdleTimeoutError,
ResponseTimeoutError,
TransferTimeoutError,
}
33 changes: 33 additions & 0 deletions node_modules/@npmcli/agent/lib/http.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict'

const http = require('http')

const { getLookup } = require('./dns.js')
const { normalizeOptions } = require('./util.js')
const createProxy = require('./proxy/index.js')

class HttpAgent extends http.Agent {
constructor (_options = {}) {
const options = normalizeOptions(_options)
super(options)
this.proxy = createProxy({
agent: this,
lookup: getLookup(options.dns),
proxy: options.proxy,
secure: false,
})
}

createConnection (_options, callback) {
const options = normalizeOptions(_options)
return this.proxy.createConnection(options, callback)
}

addRequest (request, _options) {
const options = normalizeOptions(_options)
super.addRequest(request, _options)
return this.proxy.addRequest(request, options)
}
}

module.exports = HttpAgent
33 changes: 33 additions & 0 deletions node_modules/@npmcli/agent/lib/https.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict'

const https = require('https')

const { getLookup } = require('./dns.js')
const { normalizeOptions } = require('./util.js')
const createProxy = require('./proxy/index.js')

class HttpsAgent extends https.Agent {
constructor (_options) {
const options = normalizeOptions(_options)
super(options)
this.proxy = createProxy({
agent: this,
lookup: getLookup(options.dns),
proxy: options.proxy,
secure: true,
})
}

createConnection (_options, callback) {
const options = normalizeOptions(_options)
return this.proxy.createConnection(options, callback)
}

addRequest (request, _options) {
const options = normalizeOptions(_options)
super.addRequest(request, options)
return this.proxy.addRequest(request, options)
}
}

module.exports = HttpsAgent
135 changes: 135 additions & 0 deletions node_modules/@npmcli/agent/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
'use strict'

const { normalizeOptions } = require('./util.js')
const HttpAgent = require('./http.js')
const HttpsAgent = require('./https.js')

const AgentCache = new Map()

const proxyEnv = {}
for (const [key, value] of Object.entries(process.env)) {
const lowerKey = key.toLowerCase()
if (['https_proxy', 'http_proxy', 'proxy', 'no_proxy'].includes(lowerKey)) {
proxyEnv[lowerKey] = value
}
}

const getAgent = (url, options) => {
url = new url("https://github.com/npm/cli/pull/6706/commits/url")
options = normalizeOptions(options)

// false has meaning so this can't be a simple truthiness check
if (options.agent != null) {
return options.agent
}

const isHttps = url.protocol === 'https:'

let proxy = options.proxy
if (!proxy) {
proxy = isHttps
? proxyEnv.https_proxy
: (proxyEnv.https_proxy || proxyEnv.http_proxy || proxyEnv.proxy)
}

if (proxy) {
proxy = new url("https://github.com/npm/cli/pull/6706/commits/proxy")
let noProxy = options.noProxy || proxyEnv.no_proxy
if (typeof noProxy === 'string') {
noProxy = noProxy.split(',').map((p) => p.trim())
}

if (noProxy) {
const hostSegments = url.hostname.split('.').reverse()
const matches = noProxy.some((no) => {
const noSegments = no.split('.').filter(Boolean).reverse()
if (!noSegments.length) {
return false
}

for (let i = 0; i < noSegments.length; ++i) {
if (hostSegments[i] !== noSegments[i]) {
return false
}
}

return true
})

if (matches) {
proxy = ''
}
}
}

const timeouts = [
options.timeouts.connection || 0,
options.timeouts.idle || 0,
options.timeouts.response || 0,
options.timeouts.transfer || 0,
].join('.')

const maxSockets = options.maxSockets || 15

let proxyDescriptor = 'proxy:'
if (!proxy) {
proxyDescriptor += 'null'
} else {
proxyDescriptor += `${proxy.protocol}//`
let auth = ''

if (proxy.username) {
auth += proxy.username
}

if (proxy.password) {
auth += `:${proxy.password}`
}

if (auth) {
proxyDescriptor += `${auth}@`
}

proxyDescriptor += proxy.host
}

const key = [
`https:${isHttps}`,
proxyDescriptor,
`local-address:${options.localAddress || 'null'}`,
`strict-ssl:${isHttps ? options.rejectUnauthorized : 'false'}`,
`ca:${isHttps && options.ca || 'null'}`,
`cert:${isHttps && options.cert || 'null'}`,
`key:${isHttps && options.key || 'null'}`,
`timeouts:${timeouts}`,
`maxSockets:${maxSockets}`,
].join(':')

if (AgentCache.has(key)) {
return AgentCache.get(key)
}

const agentOptions = {
ca: options.ca,
cert: options.cert,
key: options.key,
rejectUnauthorized: options.rejectUnauthorized,
maxSockets,
timeouts: options.timeouts,
localAddress: options.localAddress,
proxy,
}

const agent = isHttps
? new HttpsAgent(agentOptions)
: new HttpAgent(agentOptions)

AgentCache.set(key, agent)
return agent
}

module.exports = {
getAgent,
HttpAgent,
HttpsAgent,
}
Loading