adjust checkpoint filters when you want to retrieve all events#380
Merged
tora-kozic merged 4 commits intomainfrom Jul 6, 2022
Merged
adjust checkpoint filters when you want to retrieve all events#380tora-kozic merged 4 commits intomainfrom
tora-kozic merged 4 commits intomainfrom
Conversation
afb1510 to
6fecdd7
Compare
tora-kozic
commented
Jul 5, 2022
src/code42cli/cmds/securitydata.py
Outdated
| return checkpoint | ||
| if checkpoint is not None: | ||
| return checkpoint | ||
| return "" |
Contributor
Author
There was a problem hiding this comment.
If the query sends None as a page token, the nextPgToken is returned as null. You have to pass an empty string as the token to get the first page.
Contributor
There was a problem hiding this comment.
We should move this logic into _get_all_file_events as we want to pass the empty string instead of None even when --use-checkpoint isn't passed, as that would cap the results of any non-checkpoint query at 10k results.
timabrmsn
approved these changes
Jul 6, 2022
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.
Appends a
riskSeverity.exists()filter in the case of using a checkpoint with just the--include-non-exposureoption (a query to retrieve all events).Going to add more descriptive error message for an
INVALID_PAGE_TOKEN400 error to py42 and should automatically be raised here.