Skip to content

Commit

Permalink
fix: replace identity check with equality check
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoVoges committed Sep 11, 2023
1 parent d4f3eab commit a24f05a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kapitan/refs/secrets/vaultkv.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ def _encrypt(self, data, encode_base64=False):
# comes up if vault is empty in specified path

# throw if 'exists' was given
if data.decode() is _ALREADY_EXISTING_SECRET_:
# TODO add identity check to object
if data.decode() == _ALREADY_EXISTING_SECRET_:
msg = f"path '{self.mount}/{self.path}/{self.key}' does not exist on Vault, but received function 'exists'"
raise VaultError(msg)

# only write new secrets
if data.decode() is not _ALREADY_EXISTING_SECRET_:
# TODO add identity check to object
if data.decode() != _ALREADY_EXISTING_SECRET_:
# append / overwrite new secret
secrets[self.key] = data.decode()

Expand Down

0 comments on commit a24f05a

Please sign in to comment.