Revert "Update storage policy on decrypt"
Barbican is being enabled, as such the metadata field should not be
modified by Pegleg. If it says encrypted, then Barbican will
encrypt.
If it says cleartext, Barbican won't. All pegleg needs to do is
decrypt the document prior to bundling it which exists already
without this change.
This reverts commit 2d88f48989
.
Change-Id: I8900f910f9816508a8ec5c23932252bb9d1fde09
This commit is contained in:
parent
4629009c96
commit
85fdcd497a
@ -174,7 +174,6 @@ class PeglegManagedSecretsDocument(object):
|
||||
def set_decrypted(self):
|
||||
"""Mark the pegleg managed document as un-encrypted."""
|
||||
self.data.pop(ENCRYPTED)
|
||||
self._embedded_document[METADATA][STORAGE_POLICY] = 'cleartext'
|
||||
|
||||
def set_secret(self, secret):
|
||||
self._embedded_document['data'] = secret
|
||||
|
@ -177,8 +177,8 @@ data: {0}-password
|
||||
"site/cicd/secrets/passphrases/"
|
||||
"cicd-passphrase-encrypted.yaml"))
|
||||
decrypted = secrets.decrypt(encrypted_path)
|
||||
assert yaml.safe_load(decrypted[encrypted_path])['data'] == yaml.safe_load(
|
||||
passphrase_doc)['data']
|
||||
assert yaml.safe_load(
|
||||
decrypted[encrypted_path]) == yaml.safe_load(passphrase_doc)
|
||||
|
||||
|
||||
@mock.patch.dict(
|
||||
@ -297,6 +297,8 @@ def test_encrypt_decrypt_using_docs(tmpdir):
|
||||
assert test_data[0]['schema'] == decrypted_data[0]['schema']
|
||||
assert test_data[0]['metadata']['name'] == decrypted_data[0]['metadata'][
|
||||
'name']
|
||||
assert test_data[0]['metadata']['storagePolicy'] == decrypted_data[0][
|
||||
'metadata']['storagePolicy']
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
|
Loading…
Reference in New Issue
Block a user