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.
The main goal of this change is to provide a way to get dynamic auth tokens into the client. The most common use-case for this is with Azure, when the token may be for a federated identity obtained using OIDC, which needs to be refreshed periodically. Another use-case for it is development scenarios against Azure when you're authenticated as yourself instead of using the static access token for the REST endpoint. In that case you might dynamically obtain/refresh a valid auth token by shelling out to
az account get-access-token
.Because these kinds of tokens have relatively short expirations, they need to be refreshed, so we accept any proc-like object and call it upon every http call to get the current token. Implementors can cache this if they wish.
I also moved some configuration validation into the client. Because the client merges key-by-key, we have to ensure we re-validate it after this merge has occurred.
I made a small change to the way configuration is merged. Previously, passing a
nil
value would have the same behavior as not passing a key at all, which is problematic if you explicitly want to set a certain key from the global config tonil
. Now, all provided keys are set, includingnil
.All Submissions: