-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[checkpoint_harmony_endpoint] Auth and pagination fixes (#12158)
* First round of fixes. - Use optional access to cursor values for shorter conditions. - Assume a 200 response from the auth endpoint, rather trying to set auth_token from the body of an error response. - Always get an auth token from cursor data or by fetching a new one, and then use it for any following request, and... - Check for the the absence of a task_id to decide when to submit a query, instead of always doing it after getting the auth token. - Don't try to get body.message from an error response, because they actually look like this: { "success": false, "error": { "status": 400, "name": "Bad Request", "details": [ "pageLimit must not be less than 10" ] } } - Clarify the comments describing each section. * Note the minimum page_limit value. * Fix the rate limiting variables. * Handle 401 responses for all requests that use the auth token. * Save the auth token after any response. Don't clear the auth token at the end of a sequence. A new token may be fetched in the middle of a sequence, so all results need to save it. * Remove unused last_page key from cursor data. * Clear the task ID when done (query task returned no results). * Improve clarity in comments and order of handling. * Remove redundant task_ready key from cursor date and just use page_token instead. Don't override page_token to null when it's already null. * Keep the token expiry time and get a new token 5 mins before expiry. * Advance startTime and endTime parameters. * Extend the default interval and improve variable descriptions. * System test just one data stream, but make it a better test, that covers polling and pagination. * Version bump, changelog entry.
- Loading branch information
1 parent
16bdfda
commit d1a9faf
Showing
24 changed files
with
1,186 additions
and
1,633 deletions.
There are no files selected for viewing
586 changes: 33 additions & 553 deletions
586
packages/checkpoint_harmony_endpoint/_dev/deploy/docker/files/config.yml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.