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, }