@salesforce/core 3.19.6-dev.0 → 3.20.0
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 +6 -0
- package/lib/crypto/crypto.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.0](https://github.com/forcedotcom/sfdx-core/compare/v3.19.6-dev.0...v3.20.0) (2022-06-08)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- cache crypto keys by homedir ([dcd493e](https://github.com/forcedotcom/sfdx-core/commit/dcd493e7745bb2717da3a4ed9aff528a51391be6))
|
|
10
|
+
|
|
5
11
|
### [3.19.6-dev.0](https://github.com/forcedotcom/sfdx-core/compare/v3.19.5...v3.19.6-dev.0) (2022-06-07)
|
|
6
12
|
|
|
7
13
|
### Features
|
package/lib/crypto/crypto.js
CHANGED
|
@@ -16,6 +16,7 @@ const kit_1 = require("@salesforce/kit");
|
|
|
16
16
|
const logger_1 = require("../logger");
|
|
17
17
|
const messages_1 = require("../messages");
|
|
18
18
|
const cache_1 = require("../util/cache");
|
|
19
|
+
const global_1 = require("../global");
|
|
19
20
|
const keyChain_1 = require("./keyChain");
|
|
20
21
|
const secureBuffer_1 = require("./secureBuffer");
|
|
21
22
|
const TAG_DELIMITER = ':';
|
|
@@ -49,20 +50,21 @@ const keychainPromises = {
|
|
|
49
50
|
* @param account The keychain account name.
|
|
50
51
|
*/
|
|
51
52
|
getPassword(_keychain, service, account) {
|
|
52
|
-
const
|
|
53
|
+
const cacheKey = `${global_1.Global.DIR}:${service}:${account}`;
|
|
54
|
+
const sb = cache_1.Cache.get(cacheKey);
|
|
53
55
|
if (!sb) {
|
|
54
56
|
return new Promise((resolve, reject) => {
|
|
55
57
|
return _keychain.getPassword({ service, account }, (err, password) => {
|
|
56
58
|
if (err)
|
|
57
59
|
return reject(err);
|
|
58
|
-
cache_1.Cache.set(
|
|
60
|
+
cache_1.Cache.set(cacheKey, makeSecureBuffer(password));
|
|
59
61
|
return resolve({ username: account, password: (0, ts_types_1.ensure)(password) });
|
|
60
62
|
});
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
else {
|
|
64
66
|
const pw = sb.value((buffer) => buffer.toString('utf8'));
|
|
65
|
-
cache_1.Cache.set(
|
|
67
|
+
cache_1.Cache.set(cacheKey, makeSecureBuffer(pw));
|
|
66
68
|
return new Promise((resolve) => {
|
|
67
69
|
return resolve({ username: account, password: (0, ts_types_1.ensure)(pw) });
|
|
68
70
|
});
|