cuddly-jelly-27016
02/18/2025, 1:19 PMMaterialiseCredentials function instead of the getTokenSourceAndMetadata function that is synchronized (in the flyteidl/go/client/admin/auth_interceptor.go).
• If the token in the token cache results in an Unauthenticated response from the flyte admin, the external command is called again.
## How was this patch tested?
• Deployed the change to a flytepropeller instance using ExternalCommand auth that returns an expiring token
• Waited for the expiry of the token and checked whether authentication still works
## Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
The issue resulted from the following PR: #5686
### Summary by Bito
This PR refactors the external command token source mechanism with improved token caching and refresh functionality. It introduces a dedicated ExternalCommandTokenSource implementation with mutex-protection to prevent unnecessary command executions, enhances authentication with proper token expiration checks, and removes legacy code while cleaning up dependencies.
Unit tests added: True
Estimated effort to review (1-5, lower is better): 4
flyteorg/flyte