ansible-vars 1.0.11__py3-none-any.whl → 1.0.12__py3-none-any.whl
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.
- ansible_vars/vault.py +8 -4
- {ansible_vars-1.0.11.dist-info → ansible_vars-1.0.12.dist-info}/METADATA +2 -2
- {ansible_vars-1.0.11.dist-info → ansible_vars-1.0.12.dist-info}/RECORD +6 -6
- {ansible_vars-1.0.11.dist-info → ansible_vars-1.0.12.dist-info}/WHEEL +0 -0
- {ansible_vars-1.0.11.dist-info → ansible_vars-1.0.12.dist-info}/entry_points.txt +0 -0
- {ansible_vars-1.0.11.dist-info → ansible_vars-1.0.12.dist-info}/licenses/LICENSE +0 -0
ansible_vars/vault.py
CHANGED
@@ -263,7 +263,7 @@ class Vault():
|
|
263
263
|
- `True`: Attempt to copy and convert the value('s leaf values) into an `EncryptedVar` before storing it
|
264
264
|
- `False`: Store the value as-is
|
265
265
|
'''
|
266
|
-
path = Vault._to_path(path)
|
266
|
+
path: tuple[Hashable, ...] = Vault._to_path(path)
|
267
267
|
# Encrypt value if necessary
|
268
268
|
if encrypt:
|
269
269
|
value = Vault._copy_data(value)
|
@@ -271,10 +271,14 @@ class Vault():
|
|
271
271
|
'''Transforms strings into `EncryptedVar`s.'''
|
272
272
|
if type(_value) is not str:
|
273
273
|
return _value
|
274
|
+
name: str | None = str(path[-1]) if path else None
|
274
275
|
if VaultKey.is_encrypted(_value):
|
275
|
-
return EncryptedVar(_value, name=
|
276
|
-
return EncryptedVar(self.keyring.encrypt(_value), name=
|
277
|
-
|
276
|
+
return EncryptedVar(_value, name=name)
|
277
|
+
return EncryptedVar(self.keyring.encrypt(_value), name=name)
|
278
|
+
if isinstance(value, dict | list):
|
279
|
+
Vault._transform_leaves(value, _encrypt_leaf, tuple())
|
280
|
+
else:
|
281
|
+
value = _encrypt_leaf(tuple(), value)
|
278
282
|
# Resolve chain and create parents if necessary, then set value for last item
|
279
283
|
parent: Any = self._data
|
280
284
|
par_path: str = ''
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ansible-vars
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.12
|
4
4
|
Summary: Manage vaults and variable files for Ansible
|
5
5
|
Project-URL: Homepage, https://github.com/xorwow/ansible-vars
|
6
6
|
Project-URL: Issues, https://github.com/xorwow/ansible-vars/issues
|
@@ -103,7 +103,7 @@ To use any functions of `ansible-vars` that require encrypting or decrypting dat
|
|
103
103
|
|
104
104
|
By default, the first loaded key is used for all encryption tasks. Note that auto-detected keys are inserted into the application's keyring *after* your explicitly added ones, so the first key you add will usually be the encryption key. If you want to make sure a certain key is used, reference its identifier using `--encryption-key|-K <identifier>`.
|
105
105
|
|
106
|
-
You can disable automatic key detection by flagging `--no-
|
106
|
+
You can disable automatic key detection by flagging `--no-detect-keys|-D`. Use `ansible-vars keyring` to view all available keys.
|
107
107
|
|
108
108
|
#### Encryption salts
|
109
109
|
|
@@ -3,10 +3,10 @@ ansible_vars/cli.py,sha256=u9kuZN304BQ5NGd8-dWnogmxXlnWl0_eD9iLcQEvbdQ,65917
|
|
3
3
|
ansible_vars/constants.py,sha256=VNr78qbzdJ0Vn0psbzjjQngNG3VbHhk6NXTz30VNUno,1622
|
4
4
|
ansible_vars/errors.py,sha256=6dzyksPKWira9O2-Ir3MIOwr4XjN9MSBiRp5e6siY6Q,1256
|
5
5
|
ansible_vars/util.py,sha256=UwGPBT19pee7lBpWuBzLPAvcrHUBAn6i1MrJvzM9OQ4,21265
|
6
|
-
ansible_vars/vault.py,sha256=
|
6
|
+
ansible_vars/vault.py,sha256=ZrlUIjSBKQPjQg5NqbpfTzkhca7x-tvMrH9gFn1g2xE,46947
|
7
7
|
ansible_vars/vault_crypt.py,sha256=nh2k686nTI3yERIp-qzx5iDE1kZKg10YG019QeZDnLM,10019
|
8
|
-
ansible_vars-1.0.
|
9
|
-
ansible_vars-1.0.
|
10
|
-
ansible_vars-1.0.
|
11
|
-
ansible_vars-1.0.
|
12
|
-
ansible_vars-1.0.
|
8
|
+
ansible_vars-1.0.12.dist-info/METADATA,sha256=6Qy4OTNpY28l6B4AaUok0Fv_SSzvImMcVmyy1ScjyGU,18830
|
9
|
+
ansible_vars-1.0.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
10
|
+
ansible_vars-1.0.12.dist-info/entry_points.txt,sha256=RrhkEH0MbfRzflguVrfYfthsFC5V2fkFnizUG3uHMtQ,55
|
11
|
+
ansible_vars-1.0.12.dist-info/licenses/LICENSE,sha256=ocyJHLG5wD12qB4uam2pqWTHIJmzloiyNyTex6Q2DKo,1062
|
12
|
+
ansible_vars-1.0.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|