Skip to content

Commit

Permalink
chore: remove redundant FGA_CLIENT_REQUEST_CLIENT_ID insertions
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Aug 13, 2024
1 parent 0bc28aa commit ee59caf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
12 changes: 0 additions & 12 deletions src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

package dev.openfga.sdk.api.auth;

import static dev.openfga.sdk.util.StringUtil.isNullOrWhitespace;

import dev.openfga.sdk.api.client.*;
import dev.openfga.sdk.api.configuration.*;
import dev.openfga.sdk.errors.ApiException;
Expand Down Expand Up @@ -70,16 +68,6 @@ public CompletableFuture<String> getAccessToken() throws FgaInvalidParameterExce

Map<Attribute, String> attributesMap = new HashMap<>();

try {
if (!isNullOrWhitespace(
config.getCredentials().getClientCredentials().getClientId())) {
attributesMap.put(
dev.openfga.sdk.telemetry.Attributes.FGA_CLIENT_REQUEST_CLIENT_ID,
config.getCredentials().getClientCredentials().getClientId());
}
} catch (Exception e) {
}

telemetry.metrics().credentialsRequest(1L, attributesMap);

return CompletableFuture.completedFuture(token.getToken());
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ public CompletableFuture<ApiResponse<T>> attemptHttpRequest() throws ApiExceptio
addTelemetryAttribute(Attributes.HTTP_REQUEST_METHOD, request.method());
addTelemetryAttribute(Attributes.USER_AGENT, configuration.getUserAgent());

try {
if (!isNullOrWhitespace(
configuration.getCredentials().getClientCredentials().getClientId())) {
addTelemetryAttribute(
Attributes.FGA_CLIENT_REQUEST_CLIENT_ID,
configuration.getCredentials().getClientCredentials().getClientId());
}
} catch (Exception e) {
}

return attemptHttpRequest(createClient(), 0, null);
}

Expand Down

0 comments on commit ee59caf

Please sign in to comment.