Skip to content

Commit

Permalink
add request type untracked.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumin8 committed Sep 27, 2024
1 parent 8742cc7 commit dd90f83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public String getUniverseDomain() throws IOException {
}

private String getUniverseDomainFromMetadata() throws IOException {
HttpResponse response = getMetadataResponse(getUniverseDomainUrl(), RequestType.UNSPECIFIED);
HttpResponse response = getMetadataResponse(getUniverseDomainUrl(), RequestType.UNTRACKED);
int statusCode = response.getStatusCode();
if (statusCode == HttpStatusCodes.STATUS_CODE_NOT_FOUND) {
return Credentials.GOOGLE_DEFAULT_UNIVERSE;
Expand Down Expand Up @@ -346,7 +346,7 @@ private HttpResponse getMetadataResponse(String url, RequestType requestType) th
request.setParser(parser);
request.getHeaders().set(METADATA_FLAVOR, GOOGLE);
// do not send metric header for getUniverseDomain and getAccount
if (requestType != RequestType.UNSPECIFIED) {
if (requestType != RequestType.UNTRACKED) {
request
.getHeaders()
.set(
Expand Down Expand Up @@ -606,7 +606,7 @@ public byte[] sign(byte[] toSign) {
}

private String getDefaultServiceAccount() throws IOException {
HttpResponse response = getMetadataResponse(getServiceAccountsUrl(), RequestType.UNSPECIFIED);
HttpResponse response = getMetadataResponse(getServiceAccountsUrl(), RequestType.UNTRACKED);
int statusCode = response.getStatusCode();
if (statusCode == HttpStatusCodes.STATUS_CODE_NOT_FOUND) {
throw new IOException(
Expand Down
3 changes: 2 additions & 1 deletion oauth2_http/java/com/google/auth/oauth2/MetricsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public enum RequestType {
ACCESS_TOKEN_REQUEST("at"),
ID_TOKEN_REQUEST("it"),
METADATA_SERVER_PIN("mds"),
UNSPECIFIED("unspecified");
UNSPECIFIED("unspecified"),
UNTRACKED("untracked");

private String label;

Expand Down

0 comments on commit dd90f83

Please sign in to comment.