Only create inner chain provider once in profile creds provider (#3387)
The `SsoCredentialsProvider` maintains an in-memory expiring cache of SSO tokens, and this cache is maintained within its instance. The `ProfileFileCredentialsProvider`, which uses `SsoCredentialsProvider` as a base/inner provider, is currently reconstructing the inner provider every time it loads credentials, which discards the SSO token cache entirely. This PR refactors the `ProfileFileCredentialsProvider` to cache the inner provider so that it is only initialized once on first load of credentials. This is done via a new `ErrorTakingOnceCell` abstraction since the same init-caching mechanism will be needed for the `ProfileFileTokenProvider` when it is implemented. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Loading
Please register or sign in to comment