Skip to content

Commit b8d1210

Browse files
rhamzehjimmyjames
authored andcommitted
feat: add support for consistency param
1 parent 5e08694 commit b8d1210

27 files changed

+375
-40
lines changed

.openapi-generator/FILES

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ docs/Computed.md
2929
docs/Condition.md
3030
docs/ConditionMetadata.md
3131
docs/ConditionParamTypeRef.md
32+
docs/ConsistencyPreference.md
3233
docs/ContextualTupleKeys.md
3334
docs/CreateStoreRequest.md
3435
docs/CreateStoreResponse.md
@@ -176,6 +177,7 @@ src/OpenFga.Sdk/Model/Computed.cs
176177
src/OpenFga.Sdk/Model/Condition.cs
177178
src/OpenFga.Sdk/Model/ConditionMetadata.cs
178179
src/OpenFga.Sdk/Model/ConditionParamTypeRef.cs
180+
src/OpenFga.Sdk/Model/ConsistencyPreference.cs
179181
src/OpenFga.Sdk/Model/ContextualTupleKeys.cs
180182
src/OpenFga.Sdk/Model/CreateStoreRequest.cs
181183
src/OpenFga.Sdk/Model/CreateStoreResponse.cs

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ namespace Example {
832832
| [**GetStore**](docs/OpenFgaApi.md#getstore) | **GET** /stores/{store_id} | Get a store |
833833
| [**ListObjects**](docs/OpenFgaApi.md#listobjects) | **POST** /stores/{store_id}/list-objects | List all objects of the given type that the user has a relation with |
834834
| [**ListStores**](docs/OpenFgaApi.md#liststores) | **GET** /stores | List all stores |
835-
| [**ListUsers**](docs/OpenFgaApi.md#listusers) | **POST** /stores/{store_id}/list-users | [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type. |
835+
| [**ListUsers**](docs/OpenFgaApi.md#listusers) | **POST** /stores/{store_id}/list-users | List the users matching the provided filter who have a certain relation to a particular type. |
836836
| [**Read**](docs/OpenFgaApi.md#read) | **POST** /stores/{store_id}/read | Get tuples from the store that matches a query, without following userset rewrite rules |
837837
| [**ReadAssertions**](docs/OpenFgaApi.md#readassertions) | **GET** /stores/{store_id}/assertions/{authorization_model_id} | Read assertions for an authorization model ID |
838838
| [**ReadAuthorizationModel**](docs/OpenFgaApi.md#readauthorizationmodel) | **GET** /stores/{store_id}/authorization-models/{id} | Return a particular version of an authorization model |
@@ -858,6 +858,7 @@ namespace Example {
858858
- [Model.Condition](docs/Condition.md)
859859
- [Model.ConditionMetadata](docs/ConditionMetadata.md)
860860
- [Model.ConditionParamTypeRef](docs/ConditionParamTypeRef.md)
861+
- [Model.ConsistencyPreference](docs/ConsistencyPreference.md)
861862
- [Model.ContextualTupleKeys](docs/ContextualTupleKeys.md)
862863
- [Model.CreateStoreRequest](docs/CreateStoreRequest.md)
863864
- [Model.CreateStoreResponse](docs/CreateStoreResponse.md)

docs/CheckRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**AuthorizationModelId** | **string** | | [optional]
1010
**Trace** | **bool** | Defaults to false. Making it true has performance implications. | [optional] [readonly]
1111
**Context** | **Object** | Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation. | [optional]
12+
**Consistency** | **ConsistencyPreference** | | [optional]
1213

1314
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
1415

docs/ConsistencyPreference.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# OpenFga.Sdk.Model.ConsistencyPreference
2+
- UNSPECIFIED: Default if not set. Behavior will be the same as MINIMIZE_LATENCY - MINIMIZE_LATENCY: Minimize latency at the potential expense of lower consistency. - HIGHER_CONSISTENCY: Prefer higher consistency, at the potential expense of increased latency.
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
9+
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
10+

docs/ExpandRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**TupleKey** | [**ExpandRequestTupleKey**](ExpandRequestTupleKey.md) | |
88
**AuthorizationModelId** | **string** | | [optional]
9+
**Consistency** | **ConsistencyPreference** | | [optional]
910

1011
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
1112

docs/ListObjectsRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**User** | **string** | |
1111
**ContextualTuples** | [**ContextualTupleKeys**](ContextualTupleKeys.md) | | [optional]
1212
**Context** | **Object** | Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation. | [optional]
13+
**Consistency** | **ConsistencyPreference** | | [optional]
1314

1415
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
1516

docs/ListUsersRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**UserFilters** | [**List<UserTypeFilter>**](UserTypeFilter.md) | The type of results returned. Only accepts exactly one value. |
1111
**ContextualTuples** | [**List<TupleKey>**](TupleKey.md) | | [optional]
1212
**Context** | **Object** | Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation. | [optional]
13+
**Consistency** | **ConsistencyPreference** | | [optional]
1314

1415
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
1516

docs/OpenFgaApi.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Method | HTTP request | Description
1111
[**GetStore**](OpenFgaApi.md#getstore) | **GET** /stores/{store_id} | Get a store
1212
[**ListObjects**](OpenFgaApi.md#listobjects) | **POST** /stores/{store_id}/list-objects | List all objects of the given type that the user has a relation with
1313
[**ListStores**](OpenFgaApi.md#liststores) | **GET** /stores | List all stores
14-
[**ListUsers**](OpenFgaApi.md#listusers) | **POST** /stores/{store_id}/list-users | [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
14+
[**ListUsers**](OpenFgaApi.md#listusers) | **POST** /stores/{store_id}/list-users | List the users matching the provided filter who have a certain relation to a particular type.
1515
[**Read**](OpenFgaApi.md#read) | **POST** /stores/{store_id}/read | Get tuples from the store that matches a query, without following userset rewrite rules
1616
[**ReadAssertions**](OpenFgaApi.md#readassertions) | **GET** /stores/{store_id}/assertions/{authorization_model_id} | Read assertions for an authorization model ID
1717
[**ReadAuthorizationModel**](OpenFgaApi.md#readauthorizationmodel) | **GET** /stores/{store_id}/authorization-models/{id} | Return a particular version of an authorization model
@@ -579,9 +579,9 @@ Name | Type | Description | Notes
579579
# **ListUsers**
580580
> ListUsersResponse ListUsers (ListUsersRequest body)
581581
582-
[EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
582+
List the users matching the provided filter who have a certain relation to a particular type.
583583

584-
The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. This API is available in an experimental capacity and can be enabled with the `- -experimentals enable-list-users` flag. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In cases where a type-bound public acces result is returned (e.g. `user:*`), it cannot be inferred that all subjects of that type have a relation to the object; it is possible that negations exist and checks should still be queried on individual subjects to ensure access to that document.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users.
584+
The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In cases where a type-bound public acces result is returned (e.g. `user:*`), it cannot be inferred that all subjects of that type have a relation to the object; it is possible that negations exist and checks should still be queried on individual subjects to ensure access to that document.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users.
585585

586586
### Example
587587
```csharp
@@ -610,7 +610,7 @@ namespace Example
610610
611611
try
612612
{
613-
// [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
613+
// List the users matching the provided filter who have a certain relation to a particular type.
614614
ListUsersResponse response = await openFgaApi.ListUsers(body);
615615
Debug.WriteLine(response);
616616
}

docs/ReadRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
**TupleKey** | [**ReadRequestTupleKey**](ReadRequestTupleKey.md) | | [optional]
88
**PageSize** | **int** | | [optional]
99
**ContinuationToken** | **string** | | [optional]
10+
**Consistency** | **ConsistencyPreference** | | [optional]
1011

1112
[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)
1213

0 commit comments

Comments
 (0)