Fix GCP bearer header construction - #13615
Open
bneradt wants to merge 1 commit into
Open
Conversation
Build the GCP Authorization header dynamically so long bearer tokens do not reuse the truncated stack buffer length. Add an end-to-end check that verifies a token longer than the old buffer is forwarded intact. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This pull request fixes GCP Authorization header construction in the origin_server_auth plugin so long bearer tokens are not truncated/mishandled, and adds an end-to-end gold test intended to validate forwarding of a token longer than the previous stack buffer.
Changes:
- Replace fixed-size stack buffer +
snprintfconstruction of the GCPAuthorization: Bearer …header with dynamic construction. - Add a new gold test path intended to verify that a long GCP bearer token is forwarded intact via a Proxy Verifier replay.
File summaries
| File | Description |
|---|---|
| tests/gold_tests/pluginTest/origin_server_auth/origin_server_auth.test.py | Adds a long-token GCP remap + verifier replay to validate bearer token forwarding beyond the old buffer size. |
| plugins/origin_server_auth/origin_server_auth.cc | Builds the GCP Authorization header dynamically to avoid truncation/length mismatch issues for long tokens. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Build the GCP Authorization header dynamically so long bearer tokens do
not reuse the truncated stack buffer length. Add an end-to-end check
that verifies a token longer than the old buffer is forwarded intact.