Skip to content

Add AssumeRole error cache (Modernized #200)#397

Merged
jtblin merged 3 commits into
mainfrom
feature/200-assumerole-error-cache
May 4, 2026
Merged

Add AssumeRole error cache (Modernized #200)#397
jtblin merged 3 commits into
mainfrom
feature/200-assumerole-error-cache

Conversation

@jtblin

@jtblin jtblin commented Apr 30, 2026

Copy link
Copy Markdown
Owner

Originally proposed by @schleyfox in #200.

This PR adds a negative cache on AssumeRole to prevent error cases from spamming the AWS API. This is set to 0 by default to preserve existing behavior, but a value of 30 seconds to 1 minute would be reasonable.

Modernization changes:

  • Rebased onto main.
  • Resolved conflicts in iam.go, server.go, and mappings/mapper.go.
  • Integrated with existing externalID support.
  • Updated documentation and CLI flags.
  • Preserved original contributor attribution.

@coveralls

coveralls commented Apr 30, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 16.936% (+1.7%) from 15.208% — feature/200-assumerole-error-cache into main

@jtblin jtblin force-pushed the feature/200-assumerole-error-cache branch 3 times, most recently from b29d698 to 89a8703 Compare April 30, 2026 01:22
jtblin and others added 2 commits May 4, 2026 10:41
When AssumeRole is successful, the success is cached for (by default) 15
minutes.  On failure, there is no cache.  In cases of misconfiguration,
this can result in a large number of AssumeRole calls against the AWS
API, which, in extreme cases, can result in API rate limiting, causing
other applications in the AWS account to experience failures.

This adds a negative cache on AssumeRole to prevent error cases from
spamming the API.
@jtblin jtblin force-pushed the feature/200-assumerole-error-cache branch from 4c44c71 to e65cb31 Compare May 4, 2026 00:47
@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@jtblin jtblin merged commit 4753aea into main May 4, 2026
16 checks passed
@jtblin jtblin deleted the feature/200-assumerole-error-cache branch May 4, 2026 00:58
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