Skip to content

Commit

Permalink
Fix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmithv11 committed Jun 24, 2023
1 parent 66e5802 commit e727c38
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions checkov/openapi/checks/resource/generic/ClearTextAPIKey.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def scan_entity_conf(self, conf: dict[str, Any], entity_type: str) -> tuple[Chec
elif conf.get("securityDefinitions"):
security_schemes = conf.get("securityDefinitions", {}) or {}


paths = conf.get('paths', {}) or {}

filtered_dict = {}
Expand All @@ -33,24 +32,20 @@ def scan_entity_conf(self, conf: dict[str, Any], entity_type: str) -> tuple[Chec
if not filtered_dict:
return CheckResult.PASSED, security_schemes


if not isinstance(paths, dict):
return CheckResult.PASSED, security_schemes
for key, path in paths.items():
if not path:
continue
if key in self.irrelevant_keys:
continue
for operation, value in path.items():
for _operation, value in path.items():
if not isinstance(value, dict):
continue
if value.get('security'):
for sec in value['security'][0]:
if sec in filtered_dict:
return CheckResult.FAILED, security_schemes


return CheckResult.PASSED, conf


check = ClearTestAPIKey()
check = ClearTestAPIKey()

0 comments on commit e727c38

Please sign in to comment.