Skip to content

feat(auth): add retries to aws boto calls #88

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

Merged
merged 4 commits into from
Sep 27, 2022
Merged

Conversation

samdammers
Copy link
Contributor

@samdammers samdammers commented Aug 17, 2022

  • implement default retries for boto3
  • implement default retries for stax api calls
  • allow config of both of these configurations via Stax Config

TOKEN_EXPIRY_THRESHOLD_IN_MINS is an outlier in terms of configuring the Stax SDK. marked as deprecated in the README and will be removed in a future release. preference to configure via the Stax Config object (to which the consumer can pass in values as ENV vars should they wish to).

the standard boto client defaults to 'legacy' which retries certain HTTP
status codes and a limited set of service errors. update retry config to
'standard' which has a broader set of errors/exceptions. in particular
it will retry 'TooManyRequestsException' which can be throttled in high
burst situations.

max retries can be configured by setting the 'STAX_API_AUTH_MAX_RETRIES'
environment var.
add default retries for stax api calls. allow these configuration to be
modified by consumers. amended prior boto3 configuration to opt for
storing in the Stax config object. marked existing token threshold ENV
configuration as deprecated.
@samdammers samdammers marked this pull request as ready for review September 6, 2022 23:24
@samdammers samdammers requested a review from a team as a code owner September 6, 2022 23:24
@samdammers samdammers requested a review from ZXYmania September 6, 2022 23:26
Anton0
Anton0 previously approved these changes Sep 6, 2022
@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Merging #88 (a73c59a) into master (344f761) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #88   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         9    +1     
  Lines          474       505   +31     
=========================================
+ Hits           474       505   +31     
Impacted Files Coverage Δ
staxapp/api.py 100.00% <100.00%> (ø)
staxapp/auth.py 100.00% <100.00%> (ø)
staxapp/aws_srp.py 100.00% <100.00%> (ø)
staxapp/config.py 100.00% <100.00%> (ø)
staxapp/openapi.py 100.00% <100.00%> (ø)
staxapp/retry.py 100.00% <100.00%> (ø)

@samdammers samdammers requested a review from Anton0 September 7, 2022 02:39
@samdammers samdammers merged commit 96fd9ce into master Sep 27, 2022
@samdammers samdammers deleted the boto-retries branch September 27, 2022 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants