Skip to content

Commit

Permalink
implement delete secret (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
myuwono committed Feb 20, 2017
1 parent d03371d commit 2cf71c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/python/covata/delta/api/requestsclient.py
Expand Up @@ -137,6 +137,15 @@ def get_secret(self, requestor_id, secret_id):
secret["encryptionDetails"][k] = b64decode(v)
return secret

def delete_secret(self, requestor_id, secret_id):
response = requests.delete(
url="{base_url}{resource}/{secret_id}".format(
base_url=self.DELTA_URL,
resource=self.RESOURCE_SECRETS,
secret_id=secret_id),
auth=self.signer(requestor_id))
response.raise_for_status()

def update_secret_metadata(self,
requestor_id, secret_id, metadata, version):
response = requests.put(
Expand Down
9 changes: 9 additions & 0 deletions src/main/python/covata/delta/interfaces.py
Expand Up @@ -98,6 +98,15 @@ def share_secret(self, requestor_id, content, encryption_details,
:rtype: dict[str, str]
"""

@abstractmethod
def delete_secret(self, requestor_id, secret_id):
"""
Deletes the secret with the given secret id.
:param str requestor_id: the authenticating identity id
:param str secret_id: the secret id to be deleted
"""

@abstractmethod
def get_secret(self, requestor_id, secret_id):
"""
Expand Down

0 comments on commit 2cf71c9

Please sign in to comment.