From 63cb066c5bbd47b0efa2ff4d1bced266818edb5a Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Tue, 20 Jan 2026 19:52:38 +0530 Subject: [PATCH 1/5] release: v0.7.4 --- CHANGELOG.md | 7 +- example/example1/go.mod | 12 ++-- example/opentelemetry/go.mod | 12 ++-- example/streamed_list_objects/go.mod | 12 ++-- internal/constants/constants.go | 102 +++++++++++++-------------- 5 files changed, 75 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfc57d5..c3d4f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,17 @@ # Changelog -## [Unreleased](https://github.com/openfga/go-sdk/compare/v0.7.3...HEAD) +## [Unreleased](https://github.com/openfga/go-sdk/compare/v0.7.4...HEAD) + +## v0.7.4 + +### [0.7.4](https://github.com/openfga/go-sdk/compare/v0.7.2...v0.7.3) (2026-01-20) - fix: ListRelations now surfaces errors instead of treating them as false (#267) - feat: add a generic API Executor `fgaClient.GetAPIExecutor()` to allow calling any OpenFGA API method. See [Calling Other Endpoints](./README.md#calling-other-endpoints) for more. - feat: add generic `ToPtr[T any](v T) *T` function for creating pointers to any type - deprecation: `PtrBool`, `PtrInt`, `PtrInt32`, `PtrInt64`, `PtrFloat32`, `PtrFloat64`, `PtrString`, and `PtrTime` are now deprecated in favor of the generic `ToPtr` function - chore: add a top-level makefile in go-sdk to simplify running tests and linters: (#250) +- feat: add fga-client.http_request.duration metric (#266) - feat: add support for StreamedListObjects endpoint (#271) ## v0.7.3 diff --git a/example/example1/go.mod b/example/example1/go.mod index 5fd14ac..01ab3f4 100644 --- a/example/example1/go.mod +++ b/example/example1/go.mod @@ -5,18 +5,18 @@ go 1.24.0 toolchain go1.25.4 // To reference published build, comment below and run `go mod tidy` -replace github.com/openfga/go-sdk v0.7.3 => ../../ +replace github.com/openfga/go-sdk v0.7.4 => ../../ -require github.com/openfga/go-sdk v0.7.3 +require github.com/openfga/go-sdk v0.7.4 require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/sourcegraph/conc v0.3.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sync v0.18.0 // indirect + golang.org/x/sync v0.19.0 // indirect ) diff --git a/example/opentelemetry/go.mod b/example/opentelemetry/go.mod index 0e6f144..0dc8bc0 100644 --- a/example/opentelemetry/go.mod +++ b/example/opentelemetry/go.mod @@ -5,12 +5,12 @@ go 1.24.0 toolchain go1.25.4 // To reference published build, comment below and run `go mod tidy` -replace github.com/openfga/go-sdk v0.7.3 => ../../ +replace github.com/openfga/go-sdk v0.7.4 => ../../ require ( github.com/joho/godotenv v1.5.1 - github.com/openfga/go-sdk v0.7.3 - go.opentelemetry.io/otel v1.38.0 + github.com/openfga/go-sdk v0.7.4 + go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 go.opentelemetry.io/otel/sdk v1.38.0 go.opentelemetry.io/otel/sdk/metric v1.38.0 @@ -25,12 +25,12 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/sync v0.18.0 // indirect + golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/text v0.31.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect diff --git a/example/streamed_list_objects/go.mod b/example/streamed_list_objects/go.mod index b5e7e84..d1397b5 100644 --- a/example/streamed_list_objects/go.mod +++ b/example/streamed_list_objects/go.mod @@ -5,10 +5,10 @@ go 1.24.0 toolchain go1.25.4 // To reference published build, comment below and run `go mod tidy` -replace github.com/openfga/go-sdk v0.7.3 => ../../ +replace github.com/openfga/go-sdk v0.7.4 => ../../ require ( - github.com/openfga/go-sdk v0.7.3 + github.com/openfga/go-sdk v0.7.4 github.com/openfga/language/pkg/go v0.2.0-beta.2 ) @@ -23,13 +23,13 @@ require ( github.com/openfga/api/proto v0.0.0-20251105142303-feed3db3d69d // indirect github.com/sourcegraph/conc v0.3.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.38.0 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6 // indirect golang.org/x/net v0.47.0 // indirect - golang.org/x/sync v0.18.0 // indirect + golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/text v0.31.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 9de5c26..12d1624 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -13,82 +13,82 @@ package constants const ( - // SdkVersion is the version of the OpenFGA Go SDK. - SdkVersion = "0.7.3" + // SdkVersion is the version of the OpenFGA Go SDK. + SdkVersion = "0.7.4" - // UserAgent is the user agent used in HTTP requests. - UserAgent = "openfga-sdk go/0.7.3" + // UserAgent is the user agent used in HTTP requests. + UserAgent = "openfga-sdk go/0.7.4" - // SampleBaseDomain is the example API domain for documentation/tests. - SampleBaseDomain = "fga.example" + // SampleBaseDomain is the example API domain for documentation/tests. + SampleBaseDomain = "fga.example" - // TestApiUrl is the API URL used for tests. - TestApiUrl = "https://api." + SampleBaseDomain + // TestApiUrl is the API URL used for tests. + TestApiUrl = "https://api." + SampleBaseDomain - // TestIssuerUrl is the API Token Issuer URL used for tests. - TestIssuerUrl = "https://issuer." + SampleBaseDomain + // TestIssuerUrl is the API Token Issuer URL used for tests. + TestIssuerUrl = "https://issuer." + SampleBaseDomain - // DefaultApiUrl is the default API URL. - DefaultApiUrl = "http://localhost:8080" + // DefaultApiUrl is the default API URL. + DefaultApiUrl = "http://localhost:8080" - // Retry configuration + // Retry configuration - // RetryMaxAllowedNumber is the maximum allowed number of retries for HTTP requests. - RetryMaxAllowedNumber = 15 + // RetryMaxAllowedNumber is the maximum allowed number of retries for HTTP requests. + RetryMaxAllowedNumber = 15 - // DefaultMaxRetry is the default maximum number of retries for HTTP requests. - DefaultMaxRetry = 3 + // DefaultMaxRetry is the default maximum number of retries for HTTP requests. + DefaultMaxRetry = 3 - // DefaultMinWaitInMs is the default minimum wait time between retries in milliseconds. - DefaultMinWaitInMs = 100 + // DefaultMinWaitInMs is the default minimum wait time between retries in milliseconds. + DefaultMinWaitInMs = 100 - // MaxBackoffTimeInSec is the maximum backoff time in seconds. - MaxBackoffTimeInSec = 120 + // MaxBackoffTimeInSec is the maximum backoff time in seconds. + MaxBackoffTimeInSec = 120 - // RetryHeaderMaxAllowableDurationInSec is the maximum allowable duration for retry headers in seconds. - RetryHeaderMaxAllowableDurationInSec = 1800 + // RetryHeaderMaxAllowableDurationInSec is the maximum allowable duration for retry headers in seconds. + RetryHeaderMaxAllowableDurationInSec = 1800 - // RetryAfterHeaderName is the standard HTTP header for retry-after. - RetryAfterHeaderName = "Retry-After" + // RetryAfterHeaderName is the standard HTTP header for retry-after. + RetryAfterHeaderName = "Retry-After" - // RateLimitResetHeaderName is the rate limit reset header name. - RateLimitResetHeaderName = "X-RateLimit-Reset" + // RateLimitResetHeaderName is the rate limit reset header name. + RateLimitResetHeaderName = "X-RateLimit-Reset" - // RateLimitResetAltHeaderName is the alternative rate limit reset header name. - RateLimitResetAltHeaderName = "X-Rate-Limit-Reset" + // RateLimitResetAltHeaderName is the alternative rate limit reset header name. + RateLimitResetAltHeaderName = "X-Rate-Limit-Reset" - // Client methods + // Client methods - // ClientMaxMethodParallelRequests is the maximum number of parallel requests for a single method. - ClientMaxMethodParallelRequests = 10 + // ClientMaxMethodParallelRequests is the maximum number of parallel requests for a single method. + ClientMaxMethodParallelRequests = 10 - // ClientMaxBatchSize is the maximum batch size for batch requests. - ClientMaxBatchSize = 50 + // ClientMaxBatchSize is the maximum batch size for batch requests. + ClientMaxBatchSize = 50 - // ClientMethodHeader is the header used to identify the client method. - ClientMethodHeader = "X-OpenFGA-Client-Method" + // ClientMethodHeader is the header used to identify the client method. + ClientMethodHeader = "X-OpenFGA-Client-Method" - // ClientBulkRequestIdHeader is the header used to identify bulk requests. - ClientBulkRequestIdHeader = "X-OpenFGA-Client-Bulk-Request-Id" + // ClientBulkRequestIdHeader is the header used to identify bulk requests. + ClientBulkRequestIdHeader = "X-OpenFGA-Client-Bulk-Request-Id" - // Connection options + // Connection options - // DefaultRequestTimeoutInMs is the default timeout for HTTP requests in milliseconds. - DefaultRequestTimeoutInMs = 10000 + // DefaultRequestTimeoutInMs is the default timeout for HTTP requests in milliseconds. + DefaultRequestTimeoutInMs = 10000 - // DefaultConnectionTimeoutInMs is the default connection timeout in milliseconds. - DefaultConnectionTimeoutInMs = 10000 + // DefaultConnectionTimeoutInMs is the default connection timeout in milliseconds. + DefaultConnectionTimeoutInMs = 10000 - // Token management + // Token management - // TokenExpiryThresholdBufferInSec is the buffer time in seconds before token expiry to consider it expired. - TokenExpiryThresholdBufferInSec = 300 + // TokenExpiryThresholdBufferInSec is the buffer time in seconds before token expiry to consider it expired. + TokenExpiryThresholdBufferInSec = 300 - // TokenExpiryJitterInSec is the jitter time in seconds to add randomness to token expiry checks. - TokenExpiryJitterInSec = 300 + // TokenExpiryJitterInSec is the jitter time in seconds to add randomness to token expiry checks. + TokenExpiryJitterInSec = 300 - // FGA Response Headers + // FGA Response Headers - // QueryDurationHeaderName is the response header name for query duration in milliseconds. - QueryDurationHeaderName = "fga-query-duration-ms" + // QueryDurationHeaderName is the response header name for query duration in milliseconds. + QueryDurationHeaderName = "fga-query-duration-ms" ) From 4a1c41463a38acc6a17323288ab871d4b11d19dd Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Tue, 20 Jan 2026 19:53:28 +0530 Subject: [PATCH 2/5] fix: compare version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3d4f5b..da05d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## v0.7.4 -### [0.7.4](https://github.com/openfga/go-sdk/compare/v0.7.2...v0.7.3) (2026-01-20) +### [0.7.4](https://github.com/openfga/go-sdk/compare/v0.7.3...v0.7.4) (2026-01-20) - fix: ListRelations now surfaces errors instead of treating them as false (#267) - feat: add a generic API Executor `fgaClient.GetAPIExecutor()` to allow calling any OpenFGA API method. See [Calling Other Endpoints](./README.md#calling-other-endpoints) for more. From e378e7835556a9d3ca7af4b667e4201df14fe94c Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Tue, 20 Jan 2026 19:58:59 +0530 Subject: [PATCH 3/5] fix: fmt constants.go --- internal/constants/constants.go | 102 ++++++++++++++++---------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 12d1624..5ba8b2c 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -13,82 +13,82 @@ package constants const ( - // SdkVersion is the version of the OpenFGA Go SDK. - SdkVersion = "0.7.4" + // SdkVersion is the version of the OpenFGA Go SDK. + SdkVersion = "0.7.4" - // UserAgent is the user agent used in HTTP requests. - UserAgent = "openfga-sdk go/0.7.4" + // UserAgent is the user agent used in HTTP requests. + UserAgent = "openfga-sdk go/0.7.4" - // SampleBaseDomain is the example API domain for documentation/tests. - SampleBaseDomain = "fga.example" + // SampleBaseDomain is the example API domain for documentation/tests. + SampleBaseDomain = "fga.example" - // TestApiUrl is the API URL used for tests. - TestApiUrl = "https://api." + SampleBaseDomain + // TestApiUrl is the API URL used for tests. + TestApiUrl = "https://api." + SampleBaseDomain - // TestIssuerUrl is the API Token Issuer URL used for tests. - TestIssuerUrl = "https://issuer." + SampleBaseDomain + // TestIssuerUrl is the API Token Issuer URL used for tests. + TestIssuerUrl = "https://issuer." + SampleBaseDomain - // DefaultApiUrl is the default API URL. - DefaultApiUrl = "http://localhost:8080" + // DefaultApiUrl is the default API URL. + DefaultApiUrl = "http://localhost:8080" - // Retry configuration + // Retry configuration - // RetryMaxAllowedNumber is the maximum allowed number of retries for HTTP requests. - RetryMaxAllowedNumber = 15 + // RetryMaxAllowedNumber is the maximum allowed number of retries for HTTP requests. + RetryMaxAllowedNumber = 15 - // DefaultMaxRetry is the default maximum number of retries for HTTP requests. - DefaultMaxRetry = 3 + // DefaultMaxRetry is the default maximum number of retries for HTTP requests. + DefaultMaxRetry = 3 - // DefaultMinWaitInMs is the default minimum wait time between retries in milliseconds. - DefaultMinWaitInMs = 100 + // DefaultMinWaitInMs is the default minimum wait time between retries in milliseconds. + DefaultMinWaitInMs = 100 - // MaxBackoffTimeInSec is the maximum backoff time in seconds. - MaxBackoffTimeInSec = 120 + // MaxBackoffTimeInSec is the maximum backoff time in seconds. + MaxBackoffTimeInSec = 120 - // RetryHeaderMaxAllowableDurationInSec is the maximum allowable duration for retry headers in seconds. - RetryHeaderMaxAllowableDurationInSec = 1800 + // RetryHeaderMaxAllowableDurationInSec is the maximum allowable duration for retry headers in seconds. + RetryHeaderMaxAllowableDurationInSec = 1800 - // RetryAfterHeaderName is the standard HTTP header for retry-after. - RetryAfterHeaderName = "Retry-After" + // RetryAfterHeaderName is the standard HTTP header for retry-after. + RetryAfterHeaderName = "Retry-After" - // RateLimitResetHeaderName is the rate limit reset header name. - RateLimitResetHeaderName = "X-RateLimit-Reset" + // RateLimitResetHeaderName is the rate limit reset header name. + RateLimitResetHeaderName = "X-RateLimit-Reset" - // RateLimitResetAltHeaderName is the alternative rate limit reset header name. - RateLimitResetAltHeaderName = "X-Rate-Limit-Reset" + // RateLimitResetAltHeaderName is the alternative rate limit reset header name. + RateLimitResetAltHeaderName = "X-Rate-Limit-Reset" - // Client methods + // Client methods - // ClientMaxMethodParallelRequests is the maximum number of parallel requests for a single method. - ClientMaxMethodParallelRequests = 10 + // ClientMaxMethodParallelRequests is the maximum number of parallel requests for a single method. + ClientMaxMethodParallelRequests = 10 - // ClientMaxBatchSize is the maximum batch size for batch requests. - ClientMaxBatchSize = 50 + // ClientMaxBatchSize is the maximum batch size for batch requests. + ClientMaxBatchSize = 50 - // ClientMethodHeader is the header used to identify the client method. - ClientMethodHeader = "X-OpenFGA-Client-Method" + // ClientMethodHeader is the header used to identify the client method. + ClientMethodHeader = "X-OpenFGA-Client-Method" - // ClientBulkRequestIdHeader is the header used to identify bulk requests. - ClientBulkRequestIdHeader = "X-OpenFGA-Client-Bulk-Request-Id" + // ClientBulkRequestIdHeader is the header used to identify bulk requests. + ClientBulkRequestIdHeader = "X-OpenFGA-Client-Bulk-Request-Id" - // Connection options + // Connection options - // DefaultRequestTimeoutInMs is the default timeout for HTTP requests in milliseconds. - DefaultRequestTimeoutInMs = 10000 + // DefaultRequestTimeoutInMs is the default timeout for HTTP requests in milliseconds. + DefaultRequestTimeoutInMs = 10000 - // DefaultConnectionTimeoutInMs is the default connection timeout in milliseconds. - DefaultConnectionTimeoutInMs = 10000 + // DefaultConnectionTimeoutInMs is the default connection timeout in milliseconds. + DefaultConnectionTimeoutInMs = 10000 - // Token management + // Token management - // TokenExpiryThresholdBufferInSec is the buffer time in seconds before token expiry to consider it expired. - TokenExpiryThresholdBufferInSec = 300 + // TokenExpiryThresholdBufferInSec is the buffer time in seconds before token expiry to consider it expired. + TokenExpiryThresholdBufferInSec = 300 - // TokenExpiryJitterInSec is the jitter time in seconds to add randomness to token expiry checks. - TokenExpiryJitterInSec = 300 + // TokenExpiryJitterInSec is the jitter time in seconds to add randomness to token expiry checks. + TokenExpiryJitterInSec = 300 - // FGA Response Headers + // FGA Response Headers - // QueryDurationHeaderName is the response header name for query duration in milliseconds. - QueryDurationHeaderName = "fga-query-duration-ms" + // QueryDurationHeaderName is the response header name for query duration in milliseconds. + QueryDurationHeaderName = "fga-query-duration-ms" ) From 59d81c41b4b6c8a2301e4be1abf44913757cd906 Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Tue, 20 Jan 2026 20:42:42 +0530 Subject: [PATCH 4/5] fix: address comments --- example/opentelemetry/go.mod | 12 ++++++------ example/streamed_list_objects/go.mod | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/example/opentelemetry/go.mod b/example/opentelemetry/go.mod index 0dc8bc0..bc3ed20 100644 --- a/example/opentelemetry/go.mod +++ b/example/opentelemetry/go.mod @@ -11,9 +11,9 @@ require ( github.com/joho/godotenv v1.5.1 github.com/openfga/go-sdk v0.7.4 go.opentelemetry.io/otel v1.39.0 - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.38.0 - go.opentelemetry.io/otel/sdk v1.38.0 - go.opentelemetry.io/otel/sdk/metric v1.38.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.39.0 + go.opentelemetry.io/otel/sdk v1.39.0 + go.opentelemetry.io/otel/sdk/metric v1.39.0 google.golang.org/grpc v1.77.0 ) @@ -31,9 +31,9 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.38.0 // indirect + golang.org/x/sys v0.39.0 // indirect golang.org/x/text v0.31.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect google.golang.org/protobuf v1.36.10 // indirect ) diff --git a/example/streamed_list_objects/go.mod b/example/streamed_list_objects/go.mod index d1397b5..1f05f1e 100644 --- a/example/streamed_list_objects/go.mod +++ b/example/streamed_list_objects/go.mod @@ -4,9 +4,6 @@ go 1.24.0 toolchain go1.25.4 -// To reference published build, comment below and run `go mod tidy` -replace github.com/openfga/go-sdk v0.7.4 => ../../ - require ( github.com/openfga/go-sdk v0.7.4 github.com/openfga/language/pkg/go v0.2.0-beta.2 From 8b527b20d4a675218e550fdba87a76c2b0ffef58 Mon Sep 17 00:00:00 2001 From: Anurag Bandyopadhyay Date: Wed, 21 Jan 2026 14:13:43 +0530 Subject: [PATCH 5/5] feat: update release date for version 0.7.4 Updated release date for version 0.7.4 and added new features and fixes. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da05d9b..d2efbfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## v0.7.4 -### [0.7.4](https://github.com/openfga/go-sdk/compare/v0.7.3...v0.7.4) (2026-01-20) +### [0.7.4](https://github.com/openfga/go-sdk/compare/v0.7.3...v0.7.4) (2026-01-21) - fix: ListRelations now surfaces errors instead of treating them as false (#267) - feat: add a generic API Executor `fgaClient.GetAPIExecutor()` to allow calling any OpenFGA API method. See [Calling Other Endpoints](./README.md#calling-other-endpoints) for more.