Fixes missing HTTP header X-Goog-User-Project #2348
Merged
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.
Flank does not pass the the HTTP header flag X-Goog-user-Project with project Id when using end user credentials. This results in HTTP error 403 (PERMISSION_DENIED). This fix sets the flag so the tests can be run by the user.
Fixes #2347
Test Plan
Before:
After:
This fix will pass HTTP header
{"X-Goog-user-Project" : project Id}
with requests for testingSteps to build & test locally
Checkout the branch
Build the project
This generates a jar inside
~/.m2/repository/com/github/flank
Configure your android project's fladle extension to use the generated local SNAPSHOT
Summary of the Changes
2 client libraries are being used namely ToolResults.java (toolresults.googleapis.com) & Testing.java (testing.googleapis.com) to interact with Firebase / Google Client.
All the classes that use these client libraries need to pass in the required header while making a request, otherwise this will result in http error 403. Changes in this PR will make sure to set the header when the client libraries are called.
ex:
{"x-goog-user-project", "my-project-id"}
Workflow:
ToolResults.java
Testing.java