Skip to content
Unverified Commit f573cc22 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

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._
parent 166f0e29
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment