Skip to content

Commit

Permalink
Fix payload handler when providing certificate keys as keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Dec 11, 2024
1 parent 6ae0c11 commit f22a609
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/falconpy/_payload/_certificate_based_exclusions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ def certificate_based_exclusions_payload(passed_keywords: dict) -> Dict[str, Lis
"issuer", "serial", "subject", "thumbprint", "valid_from", "valid_to"
]
list_keys = ["children_cids", "host_groups"]
certkey = {}
for key in certificate_keys:
# Certificate keywords overridden if certificate keyword is passed
if passed_keywords.get(key, None):
certkey[key] = passed_keywords.get(key, None)
if certkey:
item["certificate"] = certkey
for key in keys:
if passed_keywords.get(key, None):
if key == "certificate":
item["certificate"] = {}
for cert_key in certificate_keys:
item["certificate"][cert_key] = passed_keywords.get(cert_key, None)
else:
item[key] = passed_keywords.get(key, None)
item[key] = passed_keywords.get(key, None)
for key in list_keys:
if passed_keywords.get(key, None):
provided = passed_keywords.get(key, None)
Expand Down

0 comments on commit f22a609

Please sign in to comment.