From 0e3a58faa6e022b5455ab3bd7f0a67001f44174a Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 17 Apr 2020 20:13:50 -0400 Subject: [PATCH] working on deleting vs destroying stuff --- vaultpass/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vaultpass/__init__.py b/vaultpass/__init__.py index 76a808f..da17173 100644 --- a/vaultpass/__init__.py +++ b/vaultpass/__init__.py @@ -103,8 +103,8 @@ class VaultPass(object): 'kv2': {'read': self.client.secrets.kv.v2.read_secret_version, 'write': self.client.secrets.kv.v2.create_or_update_secret, 'list': self.client.secrets.kv.v2.list_secrets, - 'delete': self.client.secrets.kv.v2.delete_secret_versions, - 'destroy': self.client.secrets.kv.v2.destroy_secret_versions, + 'delete': self.client.secrets.kv.v2.delete_latest_version_of_secret, + 'destroy': self.client.secrets.kv.v2.delete_metadata_and_all_versions, 'update': self.client.secrets.kv.v2.create_or_update_secret}} handler = handler_map.get(mtype, {}).get(func, None) if not handler: @@ -278,6 +278,10 @@ class VaultPass(object): kname = lpath[-1] path = '/'.join(lpath[0:-1]) self.removeSecretName(kname, path, mount, destroy = destroy) + # The business end. + if op == 'destroy': + if mtype == 'kv2': + versions = self.client.secrets.kv.v2. return(handler(**args)) def editSecret(self, path, mount, editor_prog = constants.EDITOR, *args, **kwargs):