@dotenvx/dotenvx 1.68.1 → 1.69.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 +14 -2
- package/README.md +14 -14
- package/package.json +3 -3
- package/src/cli/actions/decrypt.js +5 -4
- package/src/cli/actions/encrypt.js +12 -11
- package/src/cli/actions/get.js +4 -3
- package/src/cli/actions/keypair.js +4 -3
- package/src/cli/actions/normalizeVltOptions.js +10 -0
- package/src/cli/actions/rotate.js +5 -4
- package/src/cli/actions/run.js +4 -3
- package/src/cli/actions/set.js +4 -3
- package/src/cli/dotenvx.js +12 -6
- package/src/db/session.js +9 -9
- package/src/lib/extensions/{ops.js → vlt.js} +25 -28
- package/src/lib/helpers/cryptography/index.js +2 -2
- package/src/lib/helpers/cryptography/mutateKeysSrc.js +1 -1
- package/src/lib/helpers/cryptography/mutateKeysSrcSync.js +1 -1
- package/src/lib/helpers/cryptography/provision.js +8 -8
- package/src/lib/helpers/cryptography/provisionSync.js +6 -6
- package/src/lib/helpers/cryptography/provisionWithPrivateKey.js +1 -1
- package/src/lib/helpers/cryptography/{opsKeypair.js → vltKeypair.js} +4 -4
- package/src/lib/helpers/cryptography/vltKeypairSync.js +14 -0
- package/src/lib/helpers/executeDynamic.js +16 -13
- package/src/lib/helpers/keyResolution/keyValues.js +5 -5
- package/src/lib/helpers/keyResolution/keyValuesFromEnvSrc.js +4 -4
- package/src/lib/helpers/keyResolution/keyValuesSync.js +7 -7
- package/src/lib/main.d.ts +21 -9
- package/src/lib/main.js +11 -11
- package/src/lib/services/decrypt.js +3 -3
- package/src/lib/services/encrypt.js +4 -4
- package/src/lib/services/get.js +4 -4
- package/src/lib/services/keypair.js +4 -4
- package/src/lib/services/rotate.js +9 -9
- package/src/lib/services/run.js +5 -5
- package/src/lib/services/sets.js +6 -6
- package/src/lib/helpers/cryptography/opsKeypairSync.js +0 -14
package/src/lib/services/sets.js
CHANGED
|
@@ -34,13 +34,13 @@ function allValuesForKey (envSrc, key) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
class Sets {
|
|
37
|
-
constructor (key, value, envs = [], encrypt = true, envKeysFilepath = null,
|
|
37
|
+
constructor (key, value, envs = [], encrypt = true, envKeysFilepath = null, noVlt = false, noCreate = false) {
|
|
38
38
|
this.envs = determine(envs, process.env)
|
|
39
39
|
this.key = key
|
|
40
40
|
this.value = value
|
|
41
41
|
this.encrypt = encrypt
|
|
42
42
|
this.envKeysFilepath = envKeysFilepath
|
|
43
|
-
this.
|
|
43
|
+
this.noVlt = noVlt
|
|
44
44
|
this.noCreate = noCreate
|
|
45
45
|
|
|
46
46
|
this.processedEnvs = []
|
|
@@ -131,11 +131,11 @@ class Sets {
|
|
|
131
131
|
let privateKey
|
|
132
132
|
|
|
133
133
|
const { publicKeyName, privateKeyName } = keyNames(filepath)
|
|
134
|
-
const { publicKeyValue, privateKeyValue } = keyValuesSync(filepath, { keysFilepath: this.envKeysFilepath,
|
|
134
|
+
const { publicKeyValue, privateKeyValue } = keyValuesSync(filepath, { keysFilepath: this.envKeysFilepath, noVlt: this.noVlt })
|
|
135
135
|
|
|
136
136
|
// first pass - provisionSync
|
|
137
137
|
if (!privateKeyValue && !publicKeyValue) {
|
|
138
|
-
const prov = provisionSync({ envSrc, envFilepath, keysFilepath: this.envKeysFilepath,
|
|
138
|
+
const prov = provisionSync({ envSrc, envFilepath, keysFilepath: this.envKeysFilepath, noVlt: this.noVlt })
|
|
139
139
|
envSrc = prov.envSrc
|
|
140
140
|
publicKey = prov.publicKey
|
|
141
141
|
privateKey = prov.privateKey
|
|
@@ -238,11 +238,11 @@ class Sets {
|
|
|
238
238
|
let privateKey
|
|
239
239
|
|
|
240
240
|
const { publicKeyName, privateKeyName } = keyNames(filepath)
|
|
241
|
-
const { publicKeyValue, privateKeyValue } = await keyValues(filepath, { keysFilepath: this.envKeysFilepath,
|
|
241
|
+
const { publicKeyValue, privateKeyValue } = await keyValues(filepath, { keysFilepath: this.envKeysFilepath, noVlt: this.noVlt })
|
|
242
242
|
|
|
243
243
|
// first pass - provision
|
|
244
244
|
if (!privateKeyValue && !publicKeyValue) {
|
|
245
|
-
const prov = await provision({ envSrc, envFilepath, keysFilepath: this.envKeysFilepath,
|
|
245
|
+
const prov = await provision({ envSrc, envFilepath, keysFilepath: this.envKeysFilepath, noVlt: this.noVlt })
|
|
246
246
|
envSrc = prov.envSrc
|
|
247
247
|
publicKey = prov.publicKey
|
|
248
248
|
privateKey = prov.privateKey
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const Ops = require('../../extensions/ops')
|
|
2
|
-
|
|
3
|
-
function opsKeypairSync (existingPublicKey, options = {}) {
|
|
4
|
-
const kp = new Ops().keypairSync(existingPublicKey, options)
|
|
5
|
-
const publicKey = kp.public_key
|
|
6
|
-
const privateKey = kp.private_key
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
publicKey,
|
|
10
|
-
privateKey
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = opsKeypairSync
|