0.6.3 (2024-10-22)
- fix: fix metrics data race issues (#139)
0.6.2 (2024-10-21)
- fix: fix batch check consistency (#131)
- fix: fix data race on TelemetryInstances (#136) - thanks @Kryvchun!
NOTE: TelemetryInstances
in telemetry.go
has been deprecated, as its usage is intended to be internal. It will be removed in a future release.
0.6.1 (2024-09-23)
- refactor(OpenTelemetry): move configuration API into public package namespace (#122)
- docs(OpenTelemetry): initial documentation and example (#123)
0.6.0 (2024-08-29)
- feat: support OpenTelemetry metrics reporting (#115)
- feat!: support for sending the consistency parameter to the read, check, list users, list objects, and expand endpoints (#117)
- chore(docs): update stale README (#113) - thanks @Code2Life
BREAKING CHANGE:
When the generator converts enums in the open API definition, by default it removes the type prefix. For example, TYPE_NAME_UNSPECIFIED
is converted to a const named UNSPECIFIED
. This leads to potential collisions with other enums, and as the consistency type is a new enum, we finally got a collision (was just a matter of time).
The fix for this is to specify "enumClassPrefix": true
in the generation config. This will then include the class name on the const name, which resoles collision issues. This means any enum value, such as INT
now becomes TYPENAME_INT
. The main impact of this is the TypeName
consts and error codes. The fix is to add the class name prefix as discussed above.
0.5.0 (2024-06-14)
- fix: correctly set HTTPClient - thanks @wonyx
- chore!: remove excluded users from ListUsers response
BREAKING CHANGE:
This version removes the ExcludedUsers
field from the ListUsersResponse
and ClientListUsersResponse
structs,
for more details see the associated API change.
0.4.0 (2024-05-30)
- feat!: remove store ID from API config, allow store ID override per-request (see README for additional documentation and examples)
- fix: only retry on client credential requests that are 429 or 5x
BREAKING CHANGE:
This version removes the StoreId
from the API client configuration. Instead, the StoreId
parameter
must now be passed to each of the API methods that require a store ID.
If you are using api_open_fga.go
directly, you will now need to pass the StoreId
parameter.
0.3.7 (2024-05-08)
- feat: Add MaxParallelRequests option in ListRelations (#93) - thanks @gurleensethi
- chore: lower required go version to 1.21 (fixes #94)
0.3.6 (2024-04-30)
- feat: support the ListUsers endpoint (#81)
- fix: do not call ReadAuthorizationModel on BatchCheck or non-Transactional Write (#78)
- chore: fix typos in the readme (#91) - thanks @balaji-dongare
- chore!: raise required go version to 1.21.9
0.3.5 (2024-02-13)
- fix: don't escape HTML characters in conditions when marshalling a model
0.3.4 (2024-01-22)
- feat: configurable client credentials token url - thanks @le-yams
- fix: WriteAuthorizationModel was not passing conditions to API
0.3.3 (2023-12-21)
- fix: WriteAuthorizationModel was not passing conditions to API
- chore: add example project
0.3.2 (2023-12-20)
- fix: ListObjects was not passing context to API
- chore: downgrade target go version to 1.20
0.3.1 (2023-12-19)
- feat: oauth2 client credentials support (#62), thanks @le-yams
- fix: remove canonical import path from oauth2 packages (#64), thanks @bketelsen
0.3.0 (2023-12-11)
- feat!: initial support for conditions
- feat: support specifying a port and path for the API (You can now set the
ApiUrl
to something like:https://api.fga.exampleL8080/some_path
) - fix: resolve a bug in
NewCredentials
(#60) - thanks @harper - chore!: use latest API interfaces
- chore: dependency updates
BREAKING CHANGES: Note: This release comes with substantial breaking changes, especially to the interfaces due to the protobuf changes in the last release.
While the http interfaces did not break (you can still use v0.2.3
SDK with a v1.3.8+
server),
the grpc interface did and this caused a few changes in the interfaces of the SDK.
You will have to modify some parts of your code, but we hope this will be to the better as a lot of the parameters are now correctly marked as required, and so the Pointer-to-String conversion is no longer needed.
Some of the changes to expect:
- When initializing a client, please use
ApiUrl
. The separateApiScheme
andApiHost
fields have been deprecated
fgaClient, err := NewSdkClient(&ClientConfiguration{
ApiUrl: os.Getenv("FGA_API_URL"), // required, e.g. https://api.fga.example
StoreId: os.Getenv("FGA_STORE_ID"), // not needed when calling `CreateStore` or `ListStores`
AuthorizationModelId: os.Getenv("FGA_MODEL_ID"), // optional, recommended to be set for production
})
- When initializing a client,
AuthorizationModelId
is no longer a pointer, and you can just pass the string directly - The
OpenFgaClient
now has methods to get and set the model IDGetAuthorizationModelId
andSetAuthorizationModelId
- The following request interfaces changed:
CheckRequest
: theTupleKey
field is now of interfaceCheckRequestTupleKey
, you can also now pass inContext
ExpandRequest
: theTupleKey
field is now of interfaceExpandRequestTupleKey
ReadRequest
: theTupleKey
field is now of interfaceReadRequestTupleKey
WriteRequest
: now takesWriteRequestWrites
andWriteRequestDeletes
- And more
- The following interfaces had fields that were pointers are are now the direct value:
CreateStoreResponse
GetStoreResponse
ListStoresResponse
ListObjectsResponse
ReadChangesResponse
ReadResponse
AuthorizationModel
and several interfaces under it- And more
0.2.3 (2023-10-13)
- fix: allow setting user agent
- fix(client): resolve null pointer exceptions when getting auth model id
- fix(client): allow read to contain empty fields
- fix(client): require auth model id and store id to be ulids
- fix(client): resolve cases where req options was not respected
- fix: add retry logic to oauth
- chore: target go1.21.3 and upgrade dependencies
0.2.2 (2023-04-21)
- feat(client): add OpenFgaClient wrapper see docs, see the
v0.2.1
docs for the OpenFgaApi docs - feat(client): implement
BatchCheck
to check multiple tuples in parallel - feat(client): implement
ListRelations
to check in one call whether a user has multiple relations to an objects - feat(client): add support for a non-transactional
Write
- chore(config): bump default max retries to
15
- fix(config)!: make the capitalization of the json equivalent of the configuration consistent
- fix: retry on 5xx errors
0.2.1 (2023-01-17)
- chore(deps): upgrade
golang.org/x/net
dependency
0.2.0 (2022-12-14)
Updated to include support for OpenFGA 0.3.0
Changes:
- [BREAKING] feat(list-objects)!: response has been changed to include the object type
e.g. response that was
{"object_ids":["roadmap"]}
, will now be{"objects":["document:roadmap"]}
Fixes:
- [BREAKING] fix(models): update interfaces that had incorrectly optional fields to make them required
Chore:
- chore(deps): update dev dependencies
0.1.1 (2022-09-30)
- chore(deps): upgrade dependencies - dependency updates were accidentally reverted in v0.1.0 release
0.1.0 (2022-09-29)
- BREAKING: exported interface
TypeDefinitions
is nowWriteAuthorizationModelRequest
This is only a breaking change on the SDK, not the API. It was changed to conform to the proto changes in openfga/api. - chore(deps): upgrade dependencies
0.0.3 (2022-09-07)
- Fix incorrectly applying client_credentials validation to api_token cred method openfga/sdk-generator#21
- Target go 1.19
- Bump golang.org/x/net
- Use govulncheck in CI to check for issues
0.0.2 (2022-08-15)
Support for [ListObjects API]](https://openfga.dev/api/service#/Relationship%20Queries/ListObjects)
You call the API and receive the list of object ids from a particular type that the user has a certain relation with.
For example, to find the list of documents that Anne can read:
body := openfga.ListObjectsRequest{
AuthorizationModelId: PtrString(""),
User: PtrString("anne"),
Relation: PtrString("can_view"),
Type: PtrString("document"),
}
data, response, err := apiClient.OpenFgaApi.ListObjects(context.Background()).Body(body).Execute()
// response.object_ids = ["roadmap"]
0.0.1 (2022-06-16)
Initial OpenFGA Go SDK release
- Support for OpenFGA API
- CRUD stores
- Create, read & list authorization models
- Writing and Reading Tuples
- Checking authorization
- Using Expand to understand why access was granted