Repository navigation
feat!: read history, download reports and show the account - #5
Merged
Merged
Conversation
history.list() reads the server's replies and can search and page, and iterate() walks every page. Scans can be updated, deleted all at once with an explicit confirmation, and downloaded as reports. A scan without a result has no counts in the list and raises NoResultError when read, and a stored crawl comes back with its pages, marked incomplete if pages were left out. Adds client.me() and the plan limits, and makes the finding types and version models match what the server sends.
The server makes a report of a running or failed scan that lists no findings, so report() now reads the scan first and raises for one without a result, and says what a partial scan did not check. iterate() raises instead of asking for the same page for ever, and goes on after a full page even if the server's count is wrong. Notes are measured the way the server cuts them, and a few replies of the wrong type are no longer accepted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
History did not work on the v3 API:
history.list()could not read the replies. This fixes it and adds the rest of the history and account calls.history.list()searches and pages;history.iterate()walks every page.history.update(),delete_all(confirm=True)andreport()for JSON, SARIF, PDF, Markdown, compliance and CSV.NoResultErrorwhen read, so it never looks like a scan without findings. A stored crawl comes back with its pages, marked incomplete if pages were left out.client.me()for the account andmetadata.plan_limits().Breaking changes are in the changelog.
Tested locally on Windows with Python 3.11, 3.12 and 3.13: 317 offline tests pass, and ruff and
mypy --strictpass on 3.13. The test replies are written from the server source; nothing was run against a live server, so the live tests are not run.