Open
Description
Describe the bug
When lacework environment contains zero alerts, python-sdk is not able to handle the json response correctly and throws unexpected KeyError.
Sample trace:
Traceback (most recent call last):
...
alerts = self.lacework_client.alerts.get(
File ".../lib/python3.10/site-packages/laceworksdk/api/v2/alerts.py", line 50, in get
return_data["paging"] = response_json["paging"]
KeyError: 'paging'
To Reproduce
Steps to reproduce the behavior:
- Use lacework env with 0 alerts
- Initialize the client and fetch alerts in following manner:
alerts = lacework_client.alerts.get(
start_time=start_time_str, end_time=end_time_str
)
Please complete the following information:
- OS: macOS Sonoma 14.5 on ARM
- Library Version: Current latest eg. 4.1.0