From 91226b462f840588083f27c29e6bd5fb408d9754 Mon Sep 17 00:00:00 2001 From: droyni Date: Sun, 9 Aug 2020 01:39:19 +0300 Subject: [PATCH] added secret length to every secret attributes --- detect_secrets/core/potential_secret.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/detect_secrets/core/potential_secret.py b/detect_secrets/core/potential_secret.py index a8fca2d8c..abb2156b3 100644 --- a/detect_secrets/core/potential_secret.py +++ b/detect_secrets/core/potential_secret.py @@ -58,6 +58,7 @@ def __init__( def set_secret(self, secret): self.secret_hash = self.hash_secret(secret) + self.secret_len = len(secret) # Note: Originally, we never wanted to keep the secret value in memory, # after finding it in the codebase. However, to support verifiable @@ -86,6 +87,7 @@ def json(self): 'filename': self.filename, 'line_number': self.lineno, 'hashed_secret': self.secret_hash, + 'secret_len': self.secret_len, 'is_verified': self.is_verified, }