-
Notifications
You must be signed in to change notification settings - Fork 54
[SOAR-20177] Okta Update Rate Limiting Handle to Prevent Task Run #3648
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
base: okta-5.0.1-release
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
0e1171c to
da82f5a
Compare
| return new_logs, state, has_more_pages, 200, None | ||
| except ApiException as error: | ||
| self.logger.info(f"An API Exception has been raised. Status code: {error.status_code}. Error: {error}") | ||
| if error.status_code == 429: |
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.
i think from memory when we hit the 429 for the very first time, we need to mask this back to PIF as a 200 with has_more_pages=true so that we save the state and jump straight back into the task. Then on this follow up run we can return 429, and the state is ignored but maintained from the prev run with the rate limit cool off period
| ), | ||
| ) | ||
|
|
||
| def _prepare_query(self, state, filter_time, is_filter_datetime, events_limit, now): |
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.
should we name this _prepare_query_and_call_api seeing as we call it from within run, but never take back the query and instead it's calling the API within here?
Proposed Changes
Description
Describe the proposed changes:
PR Requirements
Developers, verify you have completed the following items by checking them off:
Testing
Unit Tests
Review our documentation on generating and writing plugin unit tests
In-Product Tests
If you are an InsightConnect customer or have access to an InsightConnect instance, the following in-product tests should be done:
Style
Review the style guide
USER nobodyin theDockerfilewhen possiblerapid7/insightconnect-python-3-38-slim-plugin:{sdk-version-num}andrapid7/insightconnect-python-3-38-plugin:{sdk-version-num}insight-plugin validatewhich callsicon_validateto linthelp.mdFunctional Checklist
tests/directory created withinsight-plugin samplestests/$action_bad.jsoninsight-plugin run -T tests/example.json --debug --jqinsight-plugin run -T all --debug --jq(use PR format at end)insight-plugin run -R tests/example.json --debug --jqinsight-plugin run --debug --jq(use PR format at end)Assessment
You must validate your work to reviewers:
insight-plugin validateand make sure everything passesinsight-plugin run -A. For single action validation:insight-plugin run tests/{file}.json -Ainsight-plugin ... | pbcopy) and paste the output in a new post on this PR