Upstream changes to fix token validity and utilizing inmemory creds source #6001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
With changes in this PR #5407 only one request was allowed to fetch auth token from the provider if multiple parallel requests came in.
There were two calls made to MaterializeCredentials, the purpose of which was to fetch the token from cache or get new token and add them to communication channel.
Expectation of fetching new token on the first MaterializeCredentials was unexpected as this was only expected to fetch the token from cache if available and add it to the communication channel.
The new change fixes this issue so that the first call is always fetching from in memory cache by introducing a new InMemoryTokenSourceProvider.
Also the Oauth token library uses relative time using the expires_in field for validity checks which doesn't work when we are returning cache tokens as it incorrectly gives an invalid expiry and client tries to use this invalid token
Modified the logic to define custom validity function which parses the exp claim and checks for validity. Also added this to baseorchestrator so that all the other auth mechanisms use the same Validity check
How was this patch tested?
This has been tested internally on Union cluster
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link