test(auth): assert quota project header injection in google-auth tests#17448
Draft
westarle wants to merge 1 commit into
Draft
test(auth): assert quota project header injection in google-auth tests#17448westarle wants to merge 1 commit into
westarle wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates credential tests across several modules (including Compute Engine, OAuth2, Service Account, and External Account) to use the before_request method instead of apply when verifying that the x-goog-user-project header is correctly set. However, in packages/google-auth/tests/compute_engine/test_credentials.py, the request variable is used without being defined, which will cause a NameError during test execution. A mock request object should be defined to resolve this issue.
Other languages like Rust, .NET, and Swift have tests verifying that the user-project configuration propagates as an HTTP request header (x-goog-user-project). The Python auth tests were only checking that the quota project property was assigned, without asserting the outbound HTTP header payload.
444abdf to
c60db79
Compare
daniel-sanche
requested changes
Jun 13, 2026
daniel-sanche
left a comment
Contributor
There was a problem hiding this comment.
Did you mean to commit those extra files at the end?
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.
Other languages like Rust, .NET, and Swift have tests verifying that the user-project configuration propagates as an HTTP request header (x-goog-user-project). The Python auth tests were only checking that the quota project property was assigned, without asserting the outbound HTTP header payload.