@salesforce/core 6.7.0 → 6.7.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/lib/org/authInfo.js +4 -2
- package/lib/util/lockRetryOptions.js +2 -2
- package/lib/util/time.js +1 -1
- package/lib/webOAuthServer.js +4 -0
- package/package.json +3 -3
package/lib/org/authInfo.js
CHANGED
|
@@ -210,8 +210,10 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
|
|
|
210
210
|
* @param options The options to generate the URL.
|
|
211
211
|
*/
|
|
212
212
|
static getAuthorizationUrl(options, oauth2) {
|
|
213
|
-
//
|
|
214
|
-
options.useVerifier
|
|
213
|
+
// Unless explicitly turned off, use a code verifier for enhanced security
|
|
214
|
+
if (options.useVerifier !== false) {
|
|
215
|
+
options.useVerifier = true;
|
|
216
|
+
}
|
|
215
217
|
const oauth2Verifier = oauth2 ?? new jsforce_1.OAuth2(options);
|
|
216
218
|
// The state parameter allows the redirectUri callback listener to ignore request
|
|
217
219
|
// that don't contain the state value.
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.lockRetryOptions = exports.lockOptions = void 0;
|
|
10
10
|
// docs: https://github.com/moxystudio/node-proper-lockfile
|
|
11
|
-
exports.lockOptions = { stale:
|
|
11
|
+
exports.lockOptions = { stale: 10_000 };
|
|
12
12
|
exports.lockRetryOptions = {
|
|
13
13
|
...exports.lockOptions,
|
|
14
|
-
retries: { retries: 10, maxTimeout:
|
|
14
|
+
retries: { retries: 10, maxTimeout: 1_000, factor: 2 },
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=lockRetryOptions.js.map
|
package/lib/util/time.js
CHANGED
|
@@ -8,6 +8,6 @@ exports.nowBigInt = void 0;
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
11
|
-
const nowBigInt = () => BigInt((node_perf_hooks_1.performance.now() + node_perf_hooks_1.performance.timeOrigin) *
|
|
11
|
+
const nowBigInt = () => BigInt((node_perf_hooks_1.performance.now() + node_perf_hooks_1.performance.timeOrigin) * 1_000_000);
|
|
12
12
|
exports.nowBigInt = nowBigInt;
|
|
13
13
|
//# sourceMappingURL=time.js.map
|
package/lib/webOAuthServer.js
CHANGED
|
@@ -155,6 +155,9 @@ class WebOAuthServer extends kit_1.AsyncCreatable {
|
|
|
155
155
|
this.oauthConfig.loginUrl = authInfo_1.AuthInfo.getDefaultInstanceUrl();
|
|
156
156
|
if (!this.oauthConfig.redirectUri)
|
|
157
157
|
this.oauthConfig.redirectUri = `http://localhost:${port}/OauthRedirect`;
|
|
158
|
+
// Unless explicitly turned off, use a code verifier as a best practice
|
|
159
|
+
if (this.oauthConfig.useVerifier !== false)
|
|
160
|
+
this.oauthConfig.useVerifier = true;
|
|
158
161
|
this.webServer = await WebServer.create({ port });
|
|
159
162
|
this.oauth2 = new jsforce_1.OAuth2(this.oauthConfig);
|
|
160
163
|
this.authUrl = authInfo_1.AuthInfo.getAuthorizationUrl(this.oauthConfig, this.oauth2);
|
|
@@ -250,6 +253,7 @@ class WebOAuthServer extends kit_1.AsyncCreatable {
|
|
|
250
253
|
this.logger.debug(`oauthConfig.loginUrl: ${this.oauthConfig.loginUrl}`);
|
|
251
254
|
this.logger.debug(`oauthConfig.clientId: ${this.oauthConfig.clientId}`);
|
|
252
255
|
this.logger.debug(`oauthConfig.redirectUri: ${this.oauthConfig.redirectUri}`);
|
|
256
|
+
this.logger.debug(`oauthConfig.useVerifier: ${this.oauthConfig.useVerifier}`);
|
|
253
257
|
return authCode;
|
|
254
258
|
}
|
|
255
259
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.1",
|
|
4
4
|
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"@salesforce/ts-sinon": "^1.4.19",
|
|
63
63
|
"@types/benchmark": "^2.1.5",
|
|
64
64
|
"@types/chai-string": "^1.4.5",
|
|
65
|
-
"@types/jsonwebtoken": "9.0.
|
|
65
|
+
"@types/jsonwebtoken": "9.0.6",
|
|
66
66
|
"@types/proper-lockfile": "^4.1.4",
|
|
67
67
|
"benchmark": "^2.1.4",
|
|
68
68
|
"chai-string": "^1.5.0",
|
|
69
69
|
"ts-node": "^10.9.2",
|
|
70
70
|
"ts-patch": "^3.1.1",
|
|
71
|
-
"typescript": "^5.
|
|
71
|
+
"typescript": "^5.4.2"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|