Commit d900479
fix(signer/awsv2): cache credentials to avoid STS hot-path calls
signer/awsv2 stored the caller's aws.Config credentials directly, so
every signed request called Credentials.Retrieve. AWS SDK v2 does not
cache credentials by default, so for STS-backed providers (assume-role,
web identity, IRSA) that is an STS call on the request hot path. Under
load it can exhaust the account's STS rate limits and cause account-wide
outages of any service that depends on STS, not just this client.
Wrap the credentials in aws.NewCredentialsCache in NewSignerWithService,
matching signer/aws. Reword the equivalent comment in signer/aws and the
signer package doc to describe the failure mode rather than framing the
cache as a performance optimization, and drop the stale "migration tracked
in a separate issue" note in signer/aws now that the SDK v2 move is done.
Co-authored-by: Ryan Yuan <ryan.yuan@crowdstrike.com>
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>1 parent 86f3955 commit d900479
3 files changed
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
| |||
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
54 | 67 | | |
55 | 68 | | |
56 | 69 | | |
| |||
0 commit comments