openfga/sdk-generator

[Go SDK] The HTTP Client in the Go SDK cannot be configurable

Closed this issue · 0 comments

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Slack Community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.

Description

The HTTP Client in the Go SDK cannot be configurable. Although there is a HTTPClient field in the ClientConfiguration, it seems that the value is not being set.

Expectation

The HTTP Client should be configurable in the Go SDK.

Reproduction

Here is an example of changing the HTTP client to a custom HTTP client of OTel:

import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"

cli := &http.Client{
    Transport: otelhttp.NewTransport(http.DefaultTransport),
}
fgaClient, err := client.NewSdkClient(&client.ClientConfiguration{
    ApiScheme:            cfg.ApiScheme,
    ApiHost:              cfg.ApiHost,
    StoreId:              cfg.StoreId,
    AuthorizationModelId: cfg.AuthorizationModelId,
    HTTPClient:           cli,
})

SDK Checklist

  • JS SDK
  • Go SDK
  • .NET SDK
  • Python SDK
  • Java SDK

OpenFGA SDK version

0.4.0

OpenFGA version

1.5.3

SDK Configuration

env var

Logs

No response

References

No response