Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 13 additions & 13 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
".": "12.0.0-pre.0",
"workspaces/arborist": "10.0.0-pre.0",
"workspaces/libnpmaccess": "10.0.3",
"workspaces/libnpmdiff": "8.1.6-pre.0",
"workspaces/libnpmexec": "10.2.6-pre.0",
"workspaces/libnpmfund": "7.0.20-pre.0",
"workspaces/libnpmorg": "8.0.1",
"workspaces/libnpmpack": "10.0.0-pre.0",
"workspaces/libnpmpublish": "11.2.0-pre.0",
"workspaces/libnpmsearch": "9.0.1",
"workspaces/libnpmteam": "8.0.2",
"workspaces/libnpmversion": "9.0.0-pre.0",
"workspaces/config": "11.0.0-pre.0"
".": "12.0.0-pre.1",
"workspaces/arborist": "10.0.0-pre.1",
"workspaces/libnpmaccess": "11.0.0-pre.0",
"workspaces/libnpmdiff": "9.0.0-pre.0",
"workspaces/libnpmexec": "11.0.0-pre.0",
"workspaces/libnpmfund": "8.0.0-pre.0",
"workspaces/libnpmorg": "9.0.0-pre.0",
"workspaces/libnpmpack": "10.0.0-pre.1",
"workspaces/libnpmpublish": "12.0.0-pre.0",
"workspaces/libnpmsearch": "10.0.0-pre.0",
"workspaces/libnpmteam": "9.0.0-pre.0",
"workspaces/libnpmversion": "9.0.0-pre.1",
"workspaces/config": "11.0.0-pre.1"
}
14 changes: 14 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -1016,3 +1016,17 @@ ecanturk <46566566+ecanturk@users.noreply.github.com>
Max <135263966+verifizieren@users.noreply.github.com>
Tea Reggi <reggi@github.com>
raazkhnl <raazkhnl@gmail.com>
Oliver Byford <oliver.byford@digital.cabinet-office.gov.uk>
Zelys <zelys@dfkhelper.com>
Jamie Magee <jamie.magee@gmail.com>
Puneet Dixit <puneetdixit4321@gmail.com>
12122J <javiergomezbu@gmail.com>
Jamie Magee <jamagee@microsoft.com>
Shaan Majid <70789625+shaanmajid@users.noreply.github.com>
Minh Vu <vuhoangminh97@gmail.com>
Dexter.k <164054284+rootvector2@users.noreply.github.com>
meeech <4623+meeech@users.noreply.github.com>
Abhinav <mrabhinav2k03@gmail.com>
Liang <github@liangmi.dev>
ded-furby <190979964+ded-furby@users.noreply.github.com>
Oldřich Jedlička <oldium.pro@gmail.com>
130 changes: 130 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions mock-registry/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,18 @@ class MockRegistry {
.reply(200, { token })
}

weblogin ({ token = 'npm_default-test-token' }) {
const doneUrl = new URL('/npm-cli-test/done', this.origin).href
weblogin ({ token = 'npm_default-test-token', doneRegistry } = {}) {
const donePath = '/npm-cli-test/done'
// doneRegistry emulates a proxy/mirror that advertises a doneUrl on a different origin than the configured registry.
// The poll itself is always mocked on this registry, since that is where the session lives.
const doneUrl = new URL(donePath, doneRegistry ?? this.origin).href
const loginUrl = new URL('/npm-cli-test/login/cli/00000000-0000-0000-0000-000000000000', this.origin).href
this.nock = this.nock
.post(this.fullPath('/-/v1/login'), () => {
return true
})
.reply(200, { doneUrl, loginUrl })
.get('/npm-cli-test/done')
.get(donePath)
.reply(200, { token })
}

Expand Down
29 changes: 28 additions & 1 deletion node_modules/npm-profile/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ const isValidUrl = u => {
}
}

// npm's web-login response names the canonical npmjs registry in `doneUrl`, which a proxy/mirror forwards verbatim.
// The poll would then hit npmjs.org instead of the proxy that holds the session, so rewrite only that npmjs host to the configured registry origin, preserving the path prefix and query string.
// Any other done host is left untouched, since a non-npmjs canonical host cannot be inferred here and may be served intentionally.
const CANONICAL_REGISTRY_HOST = 'registry.npmjs.org'

// doneUrl is already validated by isValidUrl and registry is the origin a prior
// POST /-/v1/login succeeded against, so both parse cleanly here.
const replaceDoneUrlOrigin = (doneUrl, registry) => {
if (!registry) {
return doneUrl
}
const done = new URL(doneUrl)
if (done.hostname !== CANONICAL_REGISTRY_HOST) {
return doneUrl
}
const reg = new URL(registry)
done.protocol = reg.protocol
done.host = reg.host
const prefix = reg.pathname.replace(/\/$/, '')
if (prefix && prefix !== '/' &&
done.pathname !== prefix &&
!done.pathname.startsWith(prefix + '/')) {
done.pathname = prefix + done.pathname
}
return done.href
}

const webAuth = async (opener, opts, body) => {
try {
const res = await fetch('/-/v1/login', {
Expand All @@ -47,7 +74,7 @@ const webAuth = async (opener, opts, body) => {
throw new WebLoginInvalidResponse('POST', res, content)
}

return await webAuthOpener(opener, loginUrl, doneUrl, opts)
return await webAuthOpener(opener, loginUrl, replaceDoneUrlOrigin(doneUrl, opts.registry), opts)
} catch (er) {
if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) {
throw new WebLoginNotSupported('POST', {
Expand Down
6 changes: 3 additions & 3 deletions node_modules/npm-profile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-profile",
"version": "13.0.0",
"version": "13.0.1",
"description": "Library for updating an npmjs.com profile",
"keywords": [],
"author": "GitHub Inc.",
Expand All @@ -20,7 +20,7 @@
],
"devDependencies": {
"@npmcli/eslint-config": "^7.0.0",
"@npmcli/template-oss": "5.1.0",
"@npmcli/template-oss": "5.1.1",
"nock": "^13.5.6",
"tap": "^16.0.1"
},
Expand All @@ -46,7 +46,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "5.1.0",
"version": "5.1.1",
"publish": true
}
}
68 changes: 34 additions & 34 deletions package-lock.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "npm",
"version": "12.0.0-pre.0",
"version": "12.0.0-pre.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "npm",
"version": "12.0.0-pre.0",
"version": "12.0.0-pre.1",
"bundleDependencies": [
"@isaacs/string-locale-compare",
"@npmcli/arborist",
Expand Down Expand Up @@ -87,8 +87,8 @@
],
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/arborist": "^10.0.0-pre.0",
"@npmcli/config": "^11.0.0-pre.0",
"@npmcli/arborist": "^10.0.0-pre.1",
"@npmcli/config": "^11.0.0-pre.1",
"@npmcli/fs": "^6.0.0",
"@npmcli/git": "^8.0.0",
"@npmcli/map-workspaces": "^6.0.0",
Expand All @@ -114,16 +114,16 @@
"init-package-json": "^9.0.0",
"is-cidr": "^7.0.0",
"json-parse-even-better-errors": "^6.0.0",
"libnpmaccess": "^10.0.3",
"libnpmdiff": "^8.1.6-pre.0",
"libnpmexec": "^10.2.6-pre.0",
"libnpmfund": "^7.0.20-pre.0",
"libnpmorg": "^8.0.1",
"libnpmpack": "^10.0.0-pre.0",
"libnpmpublish": "^11.2.0-pre.0",
"libnpmsearch": "^9.0.1",
"libnpmteam": "^8.0.2",
"libnpmversion": "^9.0.0-pre.0",
"libnpmaccess": "^11.0.0-pre.0",
"libnpmdiff": "^9.0.0-pre.0",
"libnpmexec": "^11.0.0-pre.0",
"libnpmfund": "^8.0.0-pre.0",
"libnpmorg": "^9.0.0-pre.0",
"libnpmpack": "^10.0.0-pre.1",
"libnpmpublish": "^12.0.0-pre.0",
"libnpmsearch": "^10.0.0-pre.0",
"libnpmteam": "^9.0.0-pre.0",
"libnpmversion": "^9.0.0-pre.1",
"make-fetch-happen": "^16.0.1",
"minimatch": "^10.2.5",
"minipass": "^7.1.3",
Expand All @@ -135,7 +135,7 @@
"npm-install-checks": "^9.0.0",
"npm-package-arg": "^14.0.0",
"npm-pick-manifest": "^12.0.0",
"npm-profile": "^13.0.0",
"npm-profile": "^13.0.1",
"npm-registry-fetch": "^20.0.1",
"npm-user-validate": "^5.0.0",
"p-map": "^7.0.4",
Expand Down Expand Up @@ -10713,9 +10713,9 @@
}
},
"node_modules/npm-profile": {
"version": "13.0.0",
"resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-13.0.0.tgz",
"integrity": "sha512-g+a2FqjE94um8oZvVMnaZCcXJDuKTOpLPVNWDd/xlWQ0FLnUNYzxUsvX55I9vRTDN+6NyC3JebxnXvPyJ81lMA==",
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-13.0.1.tgz",
"integrity": "sha512-buFDWLwggBSiT5wsjhoSHNvGy+KHaBI5n8ilvSOBkrQUbEsyKYdCV6PloJGFsQ53ZqXCqhwds/8dbvyHQuH3IA==",
"inBundle": true,
"license": "ISC",
"dependencies": {
Expand Down Expand Up @@ -16878,7 +16878,7 @@
},
"workspaces/arborist": {
"name": "@npmcli/arborist",
"version": "10.0.0-pre.0",
"version": "10.0.0-pre.1",
"license": "ISC",
"dependencies": {
"@gar/promise-retry": "^1.0.0",
Expand Down Expand Up @@ -16947,7 +16947,7 @@
},
"workspaces/config": {
"name": "@npmcli/config",
"version": "11.0.0-pre.0",
"version": "11.0.0-pre.1",
"license": "ISC",
"dependencies": {
"@npmcli/map-workspaces": "^6.0.0",
Expand All @@ -16970,7 +16970,7 @@
}
},
"workspaces/libnpmaccess": {
"version": "10.0.3",
"version": "11.0.0-pre.0",
"license": "ISC",
"dependencies": {
"npm-package-arg": "^14.0.0",
Expand All @@ -16987,10 +16987,10 @@
}
},
"workspaces/libnpmdiff": {
"version": "8.1.6-pre.0",
"version": "9.0.0-pre.0",
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^10.0.0-pre.0",
"@npmcli/arborist": "^10.0.0-pre.1",
"@npmcli/installed-package-contents": "^5.0.0",
"binary-extensions": "^3.0.0",
"diff": "^8.0.2",
Expand All @@ -17009,11 +17009,11 @@
}
},
"workspaces/libnpmexec": {
"version": "10.2.6-pre.0",
"version": "11.0.0-pre.0",
"license": "ISC",
"dependencies": {
"@gar/promise-retry": "^1.0.0",
"@npmcli/arborist": "^10.0.0-pre.0",
"@npmcli/arborist": "^10.0.0-pre.1",
"@npmcli/package-json": "^8.0.0",
"@npmcli/run-script": "^11.0.0",
"ci-info": "^4.0.0",
Expand All @@ -17040,10 +17040,10 @@
}
},
"workspaces/libnpmfund": {
"version": "7.0.20-pre.0",
"version": "8.0.0-pre.0",
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^10.0.0-pre.0"
"@npmcli/arborist": "^10.0.0-pre.1"
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.1",
Expand All @@ -17055,7 +17055,7 @@
}
},
"workspaces/libnpmorg": {
"version": "8.0.1",
"version": "9.0.0-pre.0",
"license": "ISC",
"dependencies": {
"aproba": "^2.0.0",
Expand All @@ -17073,10 +17073,10 @@
}
},
"workspaces/libnpmpack": {
"version": "10.0.0-pre.0",
"version": "10.0.0-pre.1",
"license": "ISC",
"dependencies": {
"@npmcli/arborist": "^10.0.0-pre.0",
"@npmcli/arborist": "^10.0.0-pre.1",
"@npmcli/run-script": "^11.0.0",
"npm-package-arg": "^14.0.0",
"pacote": "^22.0.0"
Expand All @@ -17093,7 +17093,7 @@
}
},
"workspaces/libnpmpublish": {
"version": "11.2.0-pre.0",
"version": "12.0.0-pre.0",
"license": "ISC",
"dependencies": {
"@npmcli/package-json": "^8.0.0",
Expand Down Expand Up @@ -17335,7 +17335,7 @@
}
},
"workspaces/libnpmsearch": {
"version": "9.0.1",
"version": "10.0.0-pre.0",
"license": "ISC",
"dependencies": {
"npm-registry-fetch": "^20.0.1"
Expand All @@ -17351,7 +17351,7 @@
}
},
"workspaces/libnpmteam": {
"version": "8.0.2",
"version": "9.0.0-pre.0",
"license": "ISC",
"dependencies": {
"aproba": "^2.0.0",
Expand All @@ -17368,7 +17368,7 @@
}
},
"workspaces/libnpmversion": {
"version": "9.0.0-pre.0",
"version": "9.0.0-pre.1",
"license": "ISC",
"dependencies": {
"@npmcli/git": "^8.0.0",
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "12.0.0-pre.0",
"version": "12.0.0-pre.1",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
Expand Down Expand Up @@ -48,8 +48,8 @@
},
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/arborist": "^10.0.0-pre.0",
"@npmcli/config": "^11.0.0-pre.0",
"@npmcli/arborist": "^10.0.0-pre.1",
"@npmcli/config": "^11.0.0-pre.1",
"@npmcli/fs": "^6.0.0",
"@npmcli/git": "^8.0.0",
"@npmcli/map-workspaces": "^6.0.0",
Expand All @@ -75,16 +75,16 @@
"init-package-json": "^9.0.0",
"is-cidr": "^7.0.0",
"json-parse-even-better-errors": "^6.0.0",
"libnpmaccess": "^10.0.3",
"libnpmdiff": "^8.1.6-pre.0",
"libnpmexec": "^10.2.6-pre.0",
"libnpmfund": "^7.0.20-pre.0",
"libnpmorg": "^8.0.1",
"libnpmpack": "^10.0.0-pre.0",
"libnpmpublish": "^11.2.0-pre.0",
"libnpmsearch": "^9.0.1",
"libnpmteam": "^8.0.2",
"libnpmversion": "^9.0.0-pre.0",
"libnpmaccess": "^11.0.0-pre.0",
"libnpmdiff": "^9.0.0-pre.0",
"libnpmexec": "^11.0.0-pre.0",
"libnpmfund": "^8.0.0-pre.0",
"libnpmorg": "^9.0.0-pre.0",
"libnpmpack": "^10.0.0-pre.1",
"libnpmpublish": "^12.0.0-pre.0",
"libnpmsearch": "^10.0.0-pre.0",
"libnpmteam": "^9.0.0-pre.0",
"libnpmversion": "^9.0.0-pre.1",
"make-fetch-happen": "^16.0.1",
"minimatch": "^10.2.5",
"minipass": "^7.1.3",
Expand All @@ -96,7 +96,7 @@
"npm-install-checks": "^9.0.0",
"npm-package-arg": "^14.0.0",
"npm-pick-manifest": "^12.0.0",
"npm-profile": "^13.0.0",
"npm-profile": "^13.0.1",
"npm-registry-fetch": "^20.0.1",
"npm-user-validate": "^5.0.0",
"p-map": "^7.0.4",
Expand Down
Loading
Loading