-
Notifications
You must be signed in to change notification settings - Fork 21
3.4.0 #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.4.0 #60
Conversation
…ded HTTP error 413 for content too large in modules/vectra.py. Also in modules/vectra.py, modified the default timeout value from 5 sec to 30 sec due to 5 being too short for most applications. Updated version in pyproject and setup.
…om platform.py that were in vectra.py. Expanded library to allow for multithreading. Added a function to download match rulesets for both vectra.py and platform.py. Expanded platform.py to support v3.4 and updated some v3.3 functions that were recently released. Also added some testing for the threading use case
modules/platform.py
Outdated
| ) | ||
| yield resp | ||
|
|
||
| if self.threads == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion, this code block to handle threaded vs non-threaded may work better as a shared function/method
modules/vectra.py
Outdated
| resp = self._request(method="get", url=resp.json()["next"]) | ||
| yield resp | ||
|
|
||
| if self.threads == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may work better as a common method that is shared...
def yield_results(self, resp, method, params):
if self.threads == 1:
while resp.json()["next"]:
resp = self._request(method=method, url=resp.json()["next"])
yield resp
else:
count = resp.json()["count"]
yield from self.get_threaded(url, count, params=params)
…ommendations to merge.
…ated tests for 3.4. Updated versioning.
| payload = open(f"{file_path}", "rb") | ||
| resp = requests.put(upload_url, data=payload) | ||
|
|
||
| if resp.status_code == 200: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: may be more future proof if you use request.codes.ok . That would handle if you get codes like 200 and 204
No description provided.