Skip to content

Commit

Permalink
Ditch the special handling of FIPS rules.
Browse files Browse the repository at this point in the history
Add a separator anyway, not doing so messes stuff up.
  • Loading branch information
J08nY committed Oct 21, 2022
1 parent 5de56e0 commit 2ad099c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sec_certs/cert_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,13 @@ def _load():
return loaded


def _process(obj, add_sep=True):
def _process(obj):
if isinstance(obj, dict):
return {k: _process(v, add_sep=add_sep) for k, v in obj.items()}
return {k: _process(v) for k, v in obj.items()}
elif isinstance(obj, list):
return [
re.compile(
REGEXEC_SEP_START + MATCH_START + rule + MATCH_END + REGEXEC_SEP_END
if add_sep
else MATCH_START + rule + MATCH_END,
REGEXEC_SEP_START + MATCH_START + rule + MATCH_END + REGEXEC_SEP_END,
re.MULTILINE,
)
for rule in obj
Expand All @@ -227,7 +225,7 @@ def _process(obj, add_sep=True):

fips_rules = {}
for rule_group in rules["fips_rules"]:
fips_rules[rule_group] = _process(rules[rule_group], False)
fips_rules[rule_group] = _process(rules[rule_group])


PANDAS_KEYWORDS_CATEGORIES: Final[List[str]] = [
Expand Down

0 comments on commit 2ad099c

Please sign in to comment.