feat(broker): support token_endpoint_headers on credentials#151
Merged
Conversation
Adds the same token_endpoint_headers map the oauth_token transform already accepts. Each entry is a discrete secret source whose resolved value is sent as a request header on the refresh POST, alongside the standard form-body client auth. Header names reach the wire verbatim: both the broker's refresh client and the oauth_token transform now use direct Header map assignment so operator-supplied casing (e.g. "x-api-key") is not rewritten to "X-Api-Key" by Header.Set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Mirrors the oauth_token transform's
token_endpoint_headersmap on the broker so credentials that need a vendor-specific header (e.g.x-api-key) alongside the standard form-body client auth can declare it. Each entry is a discrete secret source resolved per refresh, so a rotated value picks up without restart.Also fixes a latent bug in both the broker's new refresh path and the oauth_token transport:
http.Header.Setwas canonicalizing operator-supplied header names ("x-api-key" → "X-Api-Key") even though the existing comment claimed casing was preserved. Both now use direct map assignment so the original casing reaches the wire. The broker carries the wire-level test (rawnet.Listen) since httptest's parser canonicalizes on read.