Skip to content

Commit

Permalink
fix - GCP rules - AttributeError (#1210)
Browse files Browse the repository at this point in the history
* fix - GCP rules - AttributeError

* fix - GCP rules - AttributeError - linter fix
  • Loading branch information
akozlovets098 authored Apr 23, 2024
1 parent 3fde677 commit 9239b29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@


def rule(event):
if not deep_get(event, "protoPayload", "methodName").endswith("CloudBuild.CreateBuild"):
if not deep_get(event, "protoPayload", "methodName", default="METHOD_NOT_FOUND").endswith(
"CloudBuild.CreateBuild"
):
return False

authorization_info = deep_walk(event, "protoPayload", "authorizationInfo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@


def rule(event):
if not deep_get(event, "protoPayload", "methodName").endswith("ApiKeys.CreateKey"):
if not deep_get(event, "protoPayload", "methodName", default="METHOD_NOT_FOUND").endswith(
"ApiKeys.CreateKey"
):
return False

authorization_info = deep_walk(event, "protoPayload", "authorizationInfo")
Expand Down

0 comments on commit 9239b29

Please sign in to comment.