Commit 5e9f6d0
authored
fix(e2e): reap stale OAuth2 credential providers alongside API key providers (#1679)
* fix(e2e): reap stale OAuth2 credential providers in globalSetup
The e2e globalSetup already reaps stale API key credential providers, but
OAuth2 providers are a separate resource type with their own List/Delete
APIs — they do NOT appear in ListApiKeyCredentialProviders, so the existing
cleanup can never see them. The CUSTOM_JWT harness test registers a managed
OAuth2 provider (`<name>-oauth`) created outside the CloudFormation stack, so
teardown leaves it behind. These accumulate against the account's 50-provider
OAuth2 quota (L-431051DC) until every CUSTOM_JWT deploy fails with "The number
of agent identity Oauth2 credential providers in this account has reached its
limit", failing the E2E suite.
Add cleanupStaleOAuth2CredentialProviders (mirrors the API key reaper, using
ListOauth2CredentialProviders / DeleteOauth2CredentialProvider) and wire it
into globalSetup alongside the existing stack / API key / recommendation
cleanups.
* refactor(e2e): reap both provider types in one cleanupStaleCredentialProviders
Fold the OAuth2 reaping into cleanupStaleCredentialProviders rather than a
separate function + second globalSetup call. From the caller's view "reap
stale credential providers" is one job; splitting it by resource type is what
let OAuth2 providers go unreaped in the first place. The function now walks
both the API key and OAuth2 list APIs. globalSetup reverts to a single call
(no longer changed vs main).1 parent 2953d61 commit 5e9f6d0
1 file changed
Lines changed: 41 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
22 | 49 | | |
23 | 50 | | |
24 | 51 | | |
| |||
28 | 55 | | |
29 | 56 | | |
30 | 57 | | |
| 58 | + | |
| 59 | + | |
31 | 60 | | |
32 | | - | |
| 61 | + | |
33 | 62 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 63 | + | |
| 64 | + | |
38 | 65 | | |
| 66 | + | |
| 67 | + | |
39 | 68 | | |
40 | | - | |
41 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
42 | 76 | | |
0 commit comments