postman-runtime 7.40.0 → 7.41.1
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.yaml +19 -0
- package/README.md +3 -0
- package/dist/index.js +1 -1
- package/lib/requester/core.js +5 -1
- package/lib/requester/requester-pool.js +1 -0
- package/lib/requester/requester.js +3 -2
- package/lib/runner/extensions/event.command.js +12 -3
- package/lib/runner/extensions/item.command.js +6 -4
- package/package.json +11 -11
package/lib/requester/core.js
CHANGED
|
@@ -82,7 +82,10 @@ var dns = require('dns'),
|
|
|
82
82
|
|
|
83
83
|
// removes the `referer` header when a redirect happens (default: false)
|
|
84
84
|
// @note `referer` header set in the initial request will be preserved during redirect chain
|
|
85
|
-
removeRefererHeader: 'removeRefererHeaderOnRedirect'
|
|
85
|
+
removeRefererHeader: 'removeRefererHeaderOnRedirect',
|
|
86
|
+
|
|
87
|
+
// Select the HTTP protocol version to be used. Valid options are http1/http2/auto
|
|
88
|
+
protocolVersion: 'protocolVersion'
|
|
86
89
|
},
|
|
87
90
|
|
|
88
91
|
/**
|
|
@@ -399,6 +402,7 @@ module.exports = {
|
|
|
399
402
|
* @param defaultOpts.followOriginalHttpMethod
|
|
400
403
|
* @param defaultOpts.maxRedirects
|
|
401
404
|
* @param defaultOpts.maxResponseSize
|
|
405
|
+
* @param defaultOpts.protocolVersion
|
|
402
406
|
* @param defaultOpts.implicitCacheControl
|
|
403
407
|
* @param defaultOpts.implicitTraceHeader
|
|
404
408
|
* @param defaultOpts.removeRefererHeaderOnRedirect
|
|
@@ -24,6 +24,7 @@ RequesterPool = function (options, callback) {
|
|
|
24
24
|
cookieJar: _.get(options, 'requester.cookieJar'), // default set later in this constructor
|
|
25
25
|
strictSSL: _.get(options, 'requester.strictSSL'),
|
|
26
26
|
maxResponseSize: _.get(options, 'requester.maxResponseSize'),
|
|
27
|
+
protocolVersion: _.get(options, 'requester.protocolVersion'),
|
|
27
28
|
// @todo drop support in v8
|
|
28
29
|
useWhatWGUrlParser: _.get(options, 'requester.useWhatWGUrlParser', false),
|
|
29
30
|
insecureHTTPParser: _.get(options, 'requester.insecureHTTPParser'),
|
|
@@ -418,7 +418,7 @@ class Requester extends EventEmitter {
|
|
|
418
418
|
// we can't trust the integrity of this request
|
|
419
419
|
// bail out if request url is empty
|
|
420
420
|
if (!(request && request.url && request.url.toString && request.url.toString())) {
|
|
421
|
-
return onEnd(new Error('runtime:
|
|
421
|
+
return onEnd(new Error('runtime: request url is empty'));
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
cookieJar = self.options.cookieJar;
|
|
@@ -470,7 +470,8 @@ class Requester extends EventEmitter {
|
|
|
470
470
|
status: res && res.statusMessage,
|
|
471
471
|
header: responseHeaders,
|
|
472
472
|
stream: resBody,
|
|
473
|
-
responseTime: responseTime
|
|
473
|
+
responseTime: responseTime,
|
|
474
|
+
downloadedBytes: history.execution.data[0].response.downloadedBytes
|
|
474
475
|
});
|
|
475
476
|
|
|
476
477
|
onComplete(RESPONSE_END, response, history);
|
|
@@ -270,7 +270,7 @@ module.exports = {
|
|
|
270
270
|
async.mapSeries(events, function (event, next) {
|
|
271
271
|
// In case the event has no script or execution was skipped
|
|
272
272
|
// in some previous script we bail out early
|
|
273
|
-
if (!event.script ||
|
|
273
|
+
if (shouldSkipExecution || !event.script || event.script.isEmpty()) {
|
|
274
274
|
return next(null, { event });
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -434,7 +434,10 @@ module.exports = {
|
|
|
434
434
|
// instance once it is fully supported
|
|
435
435
|
result && { cookies: result.cookies });
|
|
436
436
|
}).catch(function (err) {
|
|
437
|
-
|
|
437
|
+
const error = serialisedError(err);
|
|
438
|
+
|
|
439
|
+
delete error.stack; // remove stack to avoid leaking runtime internals
|
|
440
|
+
this.host.dispatch(EXECUTION_RESPONSE_EVENT_BASE + id, requestId, error);
|
|
438
441
|
});
|
|
439
442
|
}.bind(this));
|
|
440
443
|
}.bind(this));
|
|
@@ -455,7 +458,11 @@ module.exports = {
|
|
|
455
458
|
// @todo: Expose this as a property in Collection SDK's Script
|
|
456
459
|
timeout: payload.scriptTimeout,
|
|
457
460
|
cursor: scriptCursor,
|
|
458
|
-
context:
|
|
461
|
+
context: {
|
|
462
|
+
..._.pick(payload.context, SAFE_CONTEXT_VARIABLES),
|
|
463
|
+
vaultSecrets: _.get(payload.context.vaultSecrets, '_.allowScriptAccess') ?
|
|
464
|
+
payload.context.vaultSecrets : undefined
|
|
465
|
+
},
|
|
459
466
|
resolvedPackages: resolvedPackages,
|
|
460
467
|
|
|
461
468
|
// legacy options
|
|
@@ -522,6 +529,8 @@ module.exports = {
|
|
|
522
529
|
result && result.globals && (result.globals = new sdk.VariableScope(result.globals));
|
|
523
530
|
result && result.collectionVariables &&
|
|
524
531
|
(result.collectionVariables = new sdk.VariableScope(result.collectionVariables));
|
|
532
|
+
result && result.vaultSecrets &&
|
|
533
|
+
(result.vaultSecrets = new sdk.VariableScope(result.vaultSecrets));
|
|
525
534
|
result && result.request && (result.request = new sdk.Request(result.request));
|
|
526
535
|
|
|
527
536
|
// @note Since postman-sandbox@3.5.2, response object is not included in the execution
|
|
@@ -70,7 +70,8 @@ getResponseJSON = function (response) {
|
|
|
70
70
|
type: 'Base64',
|
|
71
71
|
data: response.stream.toString('base64')
|
|
72
72
|
},
|
|
73
|
-
responseTime: response.responseTime
|
|
73
|
+
responseTime: response.responseTime,
|
|
74
|
+
downloadedBytes: response.downloadedBytes
|
|
74
75
|
};
|
|
75
76
|
};
|
|
76
77
|
|
|
@@ -137,6 +138,7 @@ module.exports = {
|
|
|
137
138
|
// create the context object for scripts to run
|
|
138
139
|
ctxTemplate = {
|
|
139
140
|
collectionVariables: collectionVariables,
|
|
141
|
+
vaultSecrets: vaultSecrets,
|
|
140
142
|
_variables: _variables,
|
|
141
143
|
globals: globals,
|
|
142
144
|
environment: environment,
|
|
@@ -150,7 +152,7 @@ module.exports = {
|
|
|
150
152
|
item: item,
|
|
151
153
|
coords: coords,
|
|
152
154
|
context: ctxTemplate,
|
|
153
|
-
trackContext: ['globals', 'environment', 'collectionVariables'],
|
|
155
|
+
trackContext: ['globals', 'environment', 'collectionVariables', 'vaultSecrets'],
|
|
154
156
|
stopOnScriptError: stopOnError,
|
|
155
157
|
stopOnFailure: stopOnFailure
|
|
156
158
|
}).done(function (prereqExecutions, prereqExecutionError, shouldSkipExecution) {
|
|
@@ -188,7 +190,7 @@ module.exports = {
|
|
|
188
190
|
|
|
189
191
|
this.queue('request', {
|
|
190
192
|
item: item,
|
|
191
|
-
vaultSecrets: vaultSecrets,
|
|
193
|
+
vaultSecrets: ctxTemplate.vaultSecrets,
|
|
192
194
|
globals: ctxTemplate.globals,
|
|
193
195
|
environment: ctxTemplate.environment,
|
|
194
196
|
collectionVariables: ctxTemplate.collectionVariables,
|
|
@@ -232,7 +234,7 @@ module.exports = {
|
|
|
232
234
|
item: item,
|
|
233
235
|
coords: coords,
|
|
234
236
|
context: ctxTemplate,
|
|
235
|
-
trackContext: ['tests', 'globals', 'environment', 'collectionVariables'],
|
|
237
|
+
trackContext: ['tests', 'globals', 'environment', 'collectionVariables', 'vaultSecrets'],
|
|
236
238
|
stopOnScriptError: stopOnError,
|
|
237
239
|
abortOnFailure: abortOnFailure,
|
|
238
240
|
stopOnFailure: stopOnFailure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postman-runtime",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.41.1",
|
|
4
4
|
"description": "Underlying library of executing Postman Collections",
|
|
5
5
|
"author": "Postman Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,19 +44,19 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@postman/tough-cookie": "4.1.3-postman.1",
|
|
46
46
|
"async": "3.2.5",
|
|
47
|
-
"aws4": "1.13.
|
|
47
|
+
"aws4": "1.13.1",
|
|
48
48
|
"handlebars": "4.7.8",
|
|
49
49
|
"httpntlm": "1.8.13",
|
|
50
|
-
"jose": "5.
|
|
50
|
+
"jose": "5.6.3",
|
|
51
51
|
"js-sha512": "0.9.0",
|
|
52
52
|
"lodash": "4.17.21",
|
|
53
53
|
"mime-types": "2.1.35",
|
|
54
54
|
"node-forge": "1.3.1",
|
|
55
55
|
"node-oauth1": "1.3.0",
|
|
56
56
|
"performance-now": "2.1.0",
|
|
57
|
-
"postman-collection": "4.
|
|
58
|
-
"postman-request": "2.88.1-postman.
|
|
59
|
-
"postman-sandbox": "5.
|
|
57
|
+
"postman-collection": "4.5.0",
|
|
58
|
+
"postman-request": "2.88.1-postman.38",
|
|
59
|
+
"postman-sandbox": "5.1.1",
|
|
60
60
|
"postman-url-encoder": "3.0.5",
|
|
61
61
|
"serialised-error": "1.1.3",
|
|
62
62
|
"strip-json-comments": "3.1.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@postman/shipit": "^0.4.0",
|
|
67
67
|
"@stylistic/eslint-plugin-js": "^1.8.0",
|
|
68
|
-
"ajv": "^8.
|
|
68
|
+
"ajv": "^8.17.1",
|
|
69
69
|
"browserify": "^17.0.0",
|
|
70
70
|
"chai": "^4.3.10",
|
|
71
71
|
"chalk": "^4.1.2",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"eslint": "^8.57.0",
|
|
75
75
|
"eslint-plugin-jsdoc": "^47.0.2",
|
|
76
76
|
"eslint-plugin-lodash": "^7.4.0",
|
|
77
|
-
"eslint-plugin-mocha": "^10.
|
|
77
|
+
"eslint-plugin-mocha": "^10.5.0",
|
|
78
78
|
"eslint-plugin-n": "^16.6.2",
|
|
79
79
|
"eslint-plugin-security": "^2.1.1",
|
|
80
80
|
"express": "^4.17.2",
|
|
81
81
|
"graphql": "^15.7.2",
|
|
82
82
|
"js-yaml": "^4.1.0",
|
|
83
|
-
"karma": "^6.4.
|
|
83
|
+
"karma": "^6.4.4",
|
|
84
84
|
"karma-browserify": "^8.1.0",
|
|
85
85
|
"karma-chrome-launcher": "^3.2.0",
|
|
86
86
|
"karma-mocha": "^2.0.1",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"shelljs": "^0.8.5",
|
|
96
96
|
"sinon": "^18.0.0",
|
|
97
97
|
"teleport-javascript": "^1.0.0",
|
|
98
|
-
"terser": "^5.31.
|
|
98
|
+
"terser": "^5.31.3",
|
|
99
99
|
"tmp": "^0.2.3",
|
|
100
|
-
"webpack": "^5.
|
|
100
|
+
"webpack": "^5.93.0",
|
|
101
101
|
"yankee": "^1.0.8"
|
|
102
102
|
},
|
|
103
103
|
"engines": {
|