@pnpm/network.fetch 1100.1.14 → 1100.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/lib/fetch.js +4 -2
- package/lib/fetchFromRegistry.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @pnpm/fetch
|
|
2
2
|
|
|
3
|
+
## 1100.1.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Authenticate Node.js runtime downloads from `nodeDownloadMirrors` with URL-scoped npm registry credentials, including bearer tokens, basic auth, and `tokenHelper` [pnpm/pnpm#14334](https://github.com/pnpm/pnpm/issues/14334).
|
|
8
|
+
|
|
9
|
+
- Network and archive retry logs hide credentials and signed query parameters in request URLs.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- @pnpm/error@1100.1.4
|
|
13
|
+
|
|
3
14
|
## 1100.1.14
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/lib/fetch.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requestRetryLogger } from '@pnpm/core-loggers';
|
|
2
|
+
import { redactUrlForDisplay } from '@pnpm/error';
|
|
2
3
|
import { operation } from '@zkochan/retry';
|
|
3
4
|
import { fetch as undiciFetch } from 'undici';
|
|
4
5
|
export {};
|
|
@@ -55,9 +56,10 @@ export async function fetch(url, opts = {}) {
|
|
|
55
56
|
}
|
|
56
57
|
// Extract error properties into a plain object because Error properties
|
|
57
58
|
// are non-enumerable and don't serialize well through the logging system
|
|
59
|
+
const displayUrl = redactUrlForDisplay(urlString);
|
|
58
60
|
const errorInfo = {
|
|
59
61
|
name: err.name,
|
|
60
|
-
message: err.message,
|
|
62
|
+
message: err.message?.replaceAll(urlString, displayUrl),
|
|
61
63
|
code: err.code,
|
|
62
64
|
errno: err.errno,
|
|
63
65
|
// For HTTP errors from ResponseError class
|
|
@@ -75,7 +77,7 @@ export async function fetch(url, opts = {}) {
|
|
|
75
77
|
maxRetries,
|
|
76
78
|
method: opts.method ?? 'GET',
|
|
77
79
|
timeout: retryTimeout,
|
|
78
|
-
url:
|
|
80
|
+
url: displayUrl,
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
83
|
});
|
package/lib/fetchFromRegistry.js
CHANGED
|
@@ -59,7 +59,7 @@ export function createFetchFromRegistry(defaultOpts) {
|
|
|
59
59
|
}
|
|
60
60
|
let redirects = 0;
|
|
61
61
|
let urlObject = new URL(url);
|
|
62
|
-
const
|
|
62
|
+
const originalOrigin = urlObject.origin;
|
|
63
63
|
/* eslint-disable no-await-in-loop */
|
|
64
64
|
while (true) {
|
|
65
65
|
const dispatcherOptions = {
|
|
@@ -87,7 +87,7 @@ export function createFetchFromRegistry(defaultOpts) {
|
|
|
87
87
|
// This is a workaround to remove authorization headers on redirect.
|
|
88
88
|
// Related pnpm issue: https://github.com/pnpm/pnpm/issues/1815
|
|
89
89
|
urlObject = resolveRedirectUrl(response, urlObject);
|
|
90
|
-
if (
|
|
90
|
+
if (originalOrigin === urlObject.origin)
|
|
91
91
|
continue;
|
|
92
92
|
if (headers['authorization']) {
|
|
93
93
|
delete headers.authorization;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/network.fetch",
|
|
3
|
-
"version": "1100.1.
|
|
3
|
+
"version": "1100.1.15",
|
|
4
4
|
"description": "Native fetch with retries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@pnpm/config.registry-auth-key": "1100.0.0",
|
|
33
33
|
"@pnpm/core-loggers": "1100.3.4",
|
|
34
|
-
"@pnpm/error": "1100.1.
|
|
34
|
+
"@pnpm/error": "1100.1.4",
|
|
35
35
|
"@pnpm/fetching.types": "1100.0.3",
|
|
36
36
|
"@pnpm/types": "1102.1.0",
|
|
37
37
|
"@zkochan/retry": "^0.2.0",
|
|
38
38
|
"lru-cache": "^11.5.2",
|
|
39
|
-
"socks": "^2.8.
|
|
39
|
+
"socks": "^2.8.10",
|
|
40
40
|
"undici": "^7.29.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@jest/globals": "30.4.1",
|
|
47
47
|
"@pnpm/logger": "1100.0.0",
|
|
48
|
-
"@pnpm/network.fetch": "1100.1.
|
|
48
|
+
"@pnpm/network.fetch": "1100.1.15",
|
|
49
49
|
"https-proxy-server-express": "0.1.2"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|