-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Copy link
Labels
dotnet-sdkAffects the C#/DotNet SDKAffects the C#/DotNet SDKenhancementNew feature or requestNew feature or requestgo-sdkAffects the Go SDKAffects the Go SDKjava-sdkAffects the Java/Kotlin SDKAffects the Java/Kotlin SDKjs-sdkAffects the JavaScript SDKAffects the JavaScript SDKpython-sdkAffects the Python SDKAffects the Python SDKruby-sdk
Description
Checklist
- I agree to the terms within the OpenFGA Code of Conduct.
Describe the problem you'd like to have solved
Users spend a lot of time working around errors resulting from writing an already existing tuple or deleting a non-existent one.
Describe the ideal solution
OpenFGA v1.10.0 introduced support for write conflict options (on missing/on duplicate).
The SDKs must expose that in the underlying API client and models, as well as add support for idempotency options in the SDK client interface.
As an example for Go (each SDK should follow it's own similar conventions), the client should support the following options through ClientWriteOptions.Conflict:
OnDuplicateWrites: Controls behavior when writing a tuple that already exists
CLIENT_WRITE_REQUEST_ON_DUPLICATE_WRITES_IGNORE- Silently skip duplicate writesCLIENT_WRITE_REQUEST_ON_DUPLICATE_WRITES_ERROR- Return error on duplicates (default)
OnMissingDeletes: Controls behavior when deleting a tuple that doesn't existCLIENT_WRITE_REQUEST_ON_MISSING_DELETES_IGNORE- Silently skip missing deletesCLIENT_WRITE_REQUEST_ON_MISSING_DELETES_ERROR- Return error on missing deletes (default)
options := client.ClientWriteOptions{
Conflict: client.ConflictOptions{
OnDuplicateWrites: client.CLIENT_WRITE_REQUEST_ON_DUPLICATE_WRITES_ERROR,
OnMissingDeletes: client.CLIENT_WRITE_REQUEST_ON_MISSING_DELETES_IGNORE,
},
}If the user does not specify the behavior, the default value as specified by the API should be sent.
Ensure that the:
- Change has tests for both the OpenFgaApi and OpenFgaClient layers
- The Write section in the README is appropriately updated
- The unreleased section of the Changelog is updated
Alternatives and current workarounds
No response
References
No response
Additional context
No response
B3zaleelportlandnorway
Sub-issues
Metadata
Metadata
Assignees
Labels
dotnet-sdkAffects the C#/DotNet SDKAffects the C#/DotNet SDKenhancementNew feature or requestNew feature or requestgo-sdkAffects the Go SDKAffects the Go SDKjava-sdkAffects the Java/Kotlin SDKAffects the Java/Kotlin SDKjs-sdkAffects the JavaScript SDKAffects the JavaScript SDKpython-sdkAffects the Python SDKAffects the Python SDKruby-sdk
Type
Projects
Status
In review