Skip to content

Commit

Permalink
fix - GCP rules - AttributeError (panther-labs#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 and egibs committed May 21, 2024
1 parent 78d077b commit cc49991
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 cc49991

Please sign in to comment.