<#6255 Move external command execution from token ...
# flyte-github
c
#6255 Move external command execution from token source provider to token source Pull request opened by andrei-trandafir ## Tracking issue #6254 ## Why are the changes needed? External command doesn't get called again if authentication starts failing due to the returned token. ## What changes were proposed in this pull request? Create a new externalCommandTokenSource that runs the external command instead of the token source provider. This results in: • The external command is called as part of the
MaterialiseCredentials
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