@salesforce/core 3.20.0 → 3.20.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.md +7 -0
- package/lib/crypto/keyChainImpl.js +6 -5
- package/lib/global.d.ts +2 -2
- package/lib/global.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.20.1](https://github.com/forcedotcom/sfdx-core/compare/v3.19.5...v3.20.1) (2022-06-08)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- cause a publish from previous skip ([069c366](https://github.com/forcedotcom/sfdx-core/commit/069c36646f5dc10a4172868ef7b5f9cd82ef7503))
|
|
10
|
+
- safer caching for nuts ([fa0af41](https://github.com/forcedotcom/sfdx-core/commit/fa0af41451a4363c84e9713685c8ece439acf3bc))
|
|
11
|
+
|
|
5
12
|
## [3.20.0](https://github.com/forcedotcom/sfdx-core/compare/v3.19.6-dev.0...v3.20.0) (2022-06-08)
|
|
6
13
|
|
|
7
14
|
### Features
|
|
@@ -317,6 +317,7 @@ const _darwinImpl = {
|
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
319
|
};
|
|
320
|
+
const getSecretFile = () => path.join(global_1.Global.DIR, 'key.json');
|
|
320
321
|
var SecretField;
|
|
321
322
|
(function (SecretField) {
|
|
322
323
|
SecretField["SERVICE"] = "service";
|
|
@@ -330,7 +331,7 @@ async function _writeFile(opts, fn) {
|
|
|
330
331
|
[SecretField.KEY]: opts.password,
|
|
331
332
|
[SecretField.SERVICE]: opts.service,
|
|
332
333
|
};
|
|
333
|
-
const secretFile =
|
|
334
|
+
const secretFile = getSecretFile();
|
|
334
335
|
await mkdirp(path.dirname(secretFile));
|
|
335
336
|
await fs.promises.writeFile(secretFile, JSON.stringify(contents, null, 4), { mode: '600' });
|
|
336
337
|
fn(null, contents);
|
|
@@ -341,7 +342,7 @@ async function _writeFile(opts, fn) {
|
|
|
341
342
|
}
|
|
342
343
|
async function _readFile() {
|
|
343
344
|
// The file and access is validated before this method is called
|
|
344
|
-
const fileContents = (0, kit_1.parseJsonMap)(await fs.promises.readFile(
|
|
345
|
+
const fileContents = (0, kit_1.parseJsonMap)(await fs.promises.readFile(getSecretFile(), 'utf8'));
|
|
345
346
|
return {
|
|
346
347
|
account: (0, ts_types_1.ensureString)(fileContents[SecretField.ACCOUNT]),
|
|
347
348
|
password: (0, ts_types_1.asString)(fileContents[SecretField.KEY]),
|
|
@@ -368,7 +369,7 @@ class GenericKeychainAccess {
|
|
|
368
369
|
else {
|
|
369
370
|
// if the service and account names don't match then maybe someone or something is editing
|
|
370
371
|
// that file. #donotallow
|
|
371
|
-
fn(messages.createError('genericKeychainServiceError', [
|
|
372
|
+
fn(messages.createError('genericKeychainServiceError', [getSecretFile()]));
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
375
|
catch (readJsonErr) {
|
|
@@ -428,7 +429,7 @@ class GenericUnixKeychainAccess extends GenericKeychainAccess {
|
|
|
428
429
|
await cb(err);
|
|
429
430
|
}
|
|
430
431
|
else {
|
|
431
|
-
const secretFile =
|
|
432
|
+
const secretFile = getSecretFile();
|
|
432
433
|
const stats = await fs.promises.stat(secretFile);
|
|
433
434
|
const octalModeStr = (stats.mode & 0o777).toString(8);
|
|
434
435
|
const EXPECTED_OCTAL_PERM_VALUE = '600';
|
|
@@ -454,7 +455,7 @@ class GenericWindowsKeychainAccess extends GenericKeychainAccess {
|
|
|
454
455
|
}
|
|
455
456
|
else {
|
|
456
457
|
try {
|
|
457
|
-
await fs.promises.access(
|
|
458
|
+
await fs.promises.access(getSecretFile(), fs.constants.R_OK | fs.constants.W_OK);
|
|
458
459
|
await cb(null);
|
|
459
460
|
}
|
|
460
461
|
catch (e) {
|
package/lib/global.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare class Global {
|
|
|
45
45
|
*/
|
|
46
46
|
static get SF_DIR(): string;
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
48
|
+
* The full system path to the preferred global state folder
|
|
49
49
|
*/
|
|
50
50
|
static get DIR(): string;
|
|
51
51
|
/**
|
|
@@ -53,7 +53,7 @@ export declare class Global {
|
|
|
53
53
|
*/
|
|
54
54
|
static readonly LOG_FILE_PATH: string;
|
|
55
55
|
/**
|
|
56
|
-
* Gets the
|
|
56
|
+
* Gets the current mode environment variable as a {@link Mode} instance.
|
|
57
57
|
*
|
|
58
58
|
* ```
|
|
59
59
|
* console.log(Global.getEnvironmentMode() === Mode.PRODUCTION);
|
package/lib/global.js
CHANGED
|
@@ -45,13 +45,13 @@ class Global {
|
|
|
45
45
|
return path.join(os.homedir(), Global.SF_STATE_FOLDER);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
48
|
+
* The full system path to the preferred global state folder
|
|
49
49
|
*/
|
|
50
50
|
static get DIR() {
|
|
51
51
|
return path.join(os.homedir(), Global.SFDX_STATE_FOLDER);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Gets the
|
|
54
|
+
* Gets the current mode environment variable as a {@link Mode} instance.
|
|
55
55
|
*
|
|
56
56
|
* ```
|
|
57
57
|
* console.log(Global.getEnvironmentMode() === Mode.PRODUCTION);
|