<#377 Use TokenCache in ClientCredentialsTokenSour...
# flyte-github
a
#377 Use TokenCache in ClientCredentialsTokenSourceProvider Pull request opened by andrewwdye TL;DR Modify
ClientCredentialsTokenSourceProvider
and
customTokenSource
to use
TokenCache
so that valid tokens can be reused across
TokenSourceProvider
instances. This is consistent with other providers. I considered refactoring FetchTokenFromCacheOrRefreshIt to share the implementation between client credentials and pkce tokens, but there are a few subtle differences between these token types that would have complicated this logic. Instead I kept the refresh logic the separate, as it is today. Type ☐ Bug Fix ☑︎ Feature ☐ Plugin Are all requirements met? ☑︎ Code completedx ☐ Smoke tested ☑︎ Unit tests added ☐ Code documentation added ☐ Any pending items have an associated Issue Complete description Replaced the existing
oauth2.Token
instance in
customerTokenSource
with a reference to the
TokenCache
originally passed to
NewTokenSourceProvider
. Overall logic stays the same. If we fail to save a new token to the cache we will warn but continue. Tracking Issue NA Follow-up issue NA flyteorg/flyteidl All checks have passed 22/22 successful checks