From ff14c087fca6b2bd94d4b14392ef132fcb35f834 Mon Sep 17 00:00:00 2001 From: Mike Garuccio Date: Fri, 3 Mar 2023 09:51:45 -0500 Subject: [PATCH] add additional file comments --- pre_commit_hook_ensure_sops/__main__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pre_commit_hook_ensure_sops/__main__.py b/pre_commit_hook_ensure_sops/__main__.py index 7633360..23a6623 100644 --- a/pre_commit_hook_ensure_sops/__main__.py +++ b/pre_commit_hook_ensure_sops/__main__.py @@ -76,6 +76,9 @@ def check_file(filename, args): # present, very likely the file is not encrypted. return False, f"{filename}: sops metadata key not found in file, is not properly encrypted" + # Checks for the presense of the encrypted_regex key within the sops section + # if present sets the encrypted regex value to the value of this key + # otherwise, sets the value to "match all strings" \S regex if 'encrypted_regex' in doc['sops']: encrypted_regex = doc['sops']['encrypted_regex'] else: