Skip to content

Commit

Permalink
Merge pull request #40 from FireTail-io/fix/keyerror-authz
Browse files Browse the repository at this point in the history
added exception catch to authz
  • Loading branch information
rileyfiretail authored Feb 6, 2024
2 parents 47d5829 + 9fa7e46 commit 41a68b1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions firetail/decorators/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,16 @@ def validate_response_authz(self, response_definition, data):
return True

def extract_item(self, data, response_data_lookup):
items = response_data_lookup.split(".")
dc = data.copy()
for i in items:
dc = dc[i]
return dc
try:
items = response_data_lookup.split(".")
dc = data.copy()
for i in items:
dc = dc[i]
return dc
except KeyError:
raise AuthzNotPopulated("Authz data does not contain expected key for authz to be evaluated")
except Exception:
raise AuthzFailed()

def is_json_schema_compatible(self, response_schema: dict) -> bool:
"""
Expand Down

0 comments on commit 41a68b1

Please sign in to comment.