-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add
X-Goog-Api-Client
metric header to outgoing requests
- Loading branch information
1 parent
feaa092
commit 7cc2988
Showing
12 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
import com.google.firebase.auth.FirebaseAuthException; | ||
import com.google.firebase.auth.MockGoogleCredentials; | ||
import com.google.firebase.internal.ApiClientUtils; | ||
import com.google.firebase.internal.SdkUtils; | ||
import com.google.firebase.testing.MultiRequestMockHttpTransport; | ||
import com.google.firebase.testing.ServiceAccount; | ||
import com.google.firebase.testing.TestResponseInterceptor; | ||
|
@@ -87,6 +88,8 @@ public void testIAMCryptoSigner() throws Exception { | |
final String url = "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/" | ||
+ "[email protected]:signBlob"; | ||
assertEquals(url, interceptor.getResponse().getRequest().getUrl().toString()); | ||
HttpRequest request = interceptor.getResponse().getRequest(); | ||
assertEquals(SdkUtils.getMetricsHeader(), request.getHeaders().get("X-Goog-Api-Client")); | ||
} | ||
|
||
@Test | ||
|
@@ -173,6 +176,7 @@ public void testMetadataService() throws Exception { | |
HttpRequest request = interceptor.getResponse().getRequest(); | ||
assertEquals(url, request.getUrl().toString()); | ||
assertEquals("Bearer test-token", request.getHeaders().getAuthorization()); | ||
assertEquals(SdkUtils.getMetricsHeader(), request.getHeaders().get("X-Goog-Api-Client")); | ||
} | ||
|
||
@Test | ||
|
@@ -203,6 +207,7 @@ public void testExplicitServiceAccountEmail() throws Exception { | |
HttpRequest request = interceptor.getResponse().getRequest(); | ||
assertEquals(url, request.getUrl().toString()); | ||
assertEquals("Bearer test-token", request.getHeaders().getAuthorization()); | ||
assertEquals(SdkUtils.getMetricsHeader(), request.getHeaders().get("X-Goog-Api-Client")); | ||
} | ||
|
||
@Test | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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