Skip to content

Commit a56da62

Browse files
ewanharriswillvedd
andcommitted
chore!: remove excluded users from ListUsers response
Co-authored-by: Will Vedder <willvedd@gmail.com>
1 parent 326fd27 commit a56da62

File tree

15 files changed

+8
-204
lines changed

15 files changed

+8
-204
lines changed

.openapi-generator/FILES

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ docs/Node.md
5050
docs/Nodes.md
5151
docs/NotFoundErrorCode.md
5252
docs/NullValue.md
53-
docs/ObjectOrUserset.md
5453
docs/ObjectRelation.md
5554
docs/OpenFgaApi.md
5655
docs/PathUnknownErrorMessageResponse.md
@@ -163,7 +162,6 @@ openfga_sdk/models/node.py
163162
openfga_sdk/models/nodes.py
164163
openfga_sdk/models/not_found_error_code.py
165164
openfga_sdk/models/null_value.py
166-
openfga_sdk/models/object_or_userset.py
167165
openfga_sdk/models/object_relation.py
168166
openfga_sdk/models/path_unknown_error_message_response.py
169167
openfga_sdk/models/read_assertions_response.py

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ async with OpenFgaClient(configuration) as api_client:
951951
response = await api_client.list_users(request, options)
952952

953953
# response.users = [{object: {type: "user", id: "81684243-9356-4421-8fbf-a4f8d36aa31b"}}, {userset: { type: "user" }}, ...]
954-
# response.excluded_users = [ {object: {type: "user", id: "4a455e27-d15a-4434-82e0-136f9c2aa4cf"}}, ... ]
955954
```
956955

957956
#### Assertions
@@ -1093,7 +1092,6 @@ Class | Method | HTTP request | Description
10931092
- [Nodes](https://github.com/openfga/python-sdk/blob/main/docs/Nodes.md)
10941093
- [NotFoundErrorCode](https://github.com/openfga/python-sdk/blob/main/docs/NotFoundErrorCode.md)
10951094
- [NullValue](https://github.com/openfga/python-sdk/blob/main/docs/NullValue.md)
1096-
- [ObjectOrUserset](https://github.com/openfga/python-sdk/blob/main/docs/ObjectOrUserset.md)
10971095
- [ObjectRelation](https://github.com/openfga/python-sdk/blob/main/docs/ObjectRelation.md)
10981096
- [PathUnknownErrorMessageResponse](https://github.com/openfga/python-sdk/blob/main/docs/PathUnknownErrorMessageResponse.md)
10991097
- [ReadAssertionsResponse](https://github.com/openfga/python-sdk/blob/main/docs/ReadAssertionsResponse.md)

docs/ListUsersResponse.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**users** | [**list[User]**](User.md) | |
8-
**excluded_users** | [**list[ObjectOrUserset]**](ObjectOrUserset.md) | |
98

109
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1110

docs/ObjectOrUserset.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/OpenFgaApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ No authorization required
600600
601601
[EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
602602

603-
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 certain cases of negation via the `but not` operator, some results are marked as excluded from the main set of results. These exclusions are returned in the `excluded_users` property and should be handled appropriately at the point of implementation.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.
603+
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.
604604

605605
### Example
606606

openfga_sdk/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
from openfga_sdk.models.nodes import Nodes
6363
from openfga_sdk.models.not_found_error_code import NotFoundErrorCode
6464
from openfga_sdk.models.null_value import NullValue
65-
from openfga_sdk.models.object_or_userset import ObjectOrUserset
6665
from openfga_sdk.models.object_relation import ObjectRelation
6766
from openfga_sdk.models.path_unknown_error_message_response import (
6867
PathUnknownErrorMessageResponse,

openfga_sdk/api/open_fga_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ async def list_stores_with_http_info(self, **kwargs):
10981098
async def list_users(self, body, **kwargs):
10991099
"""[EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
11001100
1101-
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 certain cases of negation via the `but not` operator, some results are marked as excluded from the main set of results. These exclusions are returned in the `excluded_users` property and should be handled appropriately at the point of implementation.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.
1101+
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.
11021102
11031103
>>> thread = await api.list_users(body)
11041104
@@ -1125,7 +1125,7 @@ async def list_users(self, body, **kwargs):
11251125
async def list_users_with_http_info(self, body, **kwargs):
11261126
"""[EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type.
11271127
1128-
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 certain cases of negation via the `but not` operator, some results are marked as excluded from the main set of results. These exclusions are returned in the `excluded_users` property and should be handled appropriately at the point of implementation.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.
1128+
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.
11291129
11301130
>>> thread = api.list_users_with_http_info(body)
11311131

openfga_sdk/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
from openfga_sdk.models.nodes import Nodes
4848
from openfga_sdk.models.not_found_error_code import NotFoundErrorCode
4949
from openfga_sdk.models.null_value import NullValue
50-
from openfga_sdk.models.object_or_userset import ObjectOrUserset
5150
from openfga_sdk.models.object_relation import ObjectRelation
5251
from openfga_sdk.models.path_unknown_error_message_response import (
5352
PathUnknownErrorMessageResponse,

openfga_sdk/models/list_users_response.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,20 @@ class ListUsersResponse:
3333
attribute_map (dict): The key is attribute name
3434
and the value is json key in definition.
3535
"""
36-
openapi_types = {"users": "list[User]", "excluded_users": "list[ObjectOrUserset]"}
36+
openapi_types = {"users": "list[User]"}
3737

38-
attribute_map = {"users": "users", "excluded_users": "excluded_users"}
38+
attribute_map = {"users": "users"}
3939

40-
def __init__(self, users=None, excluded_users=None, local_vars_configuration=None):
40+
def __init__(self, users=None, local_vars_configuration=None):
4141
"""ListUsersResponse - a model defined in OpenAPI"""
4242
if local_vars_configuration is None:
4343
local_vars_configuration = Configuration.get_default_copy()
4444
self.local_vars_configuration = local_vars_configuration
4545

4646
self._users = None
47-
self._excluded_users = None
4847
self.discriminator = None
4948

5049
self.users = users
51-
self.excluded_users = excluded_users
5250

5351
@property
5452
def users(self):
@@ -73,32 +71,6 @@ def users(self, users):
7371

7472
self._users = users
7573

76-
@property
77-
def excluded_users(self):
78-
"""Gets the excluded_users of this ListUsersResponse.
79-
80-
81-
:return: The excluded_users of this ListUsersResponse.
82-
:rtype: list[ObjectOrUserset]
83-
"""
84-
return self._excluded_users
85-
86-
@excluded_users.setter
87-
def excluded_users(self, excluded_users):
88-
"""Sets the excluded_users of this ListUsersResponse.
89-
90-
91-
:param excluded_users: The excluded_users of this ListUsersResponse.
92-
:type excluded_users: list[ObjectOrUserset]
93-
"""
94-
if (
95-
self.local_vars_configuration.client_side_validation
96-
and excluded_users is None
97-
):
98-
raise ValueError("Invalid value for `excluded_users`, must not be `None`")
99-
100-
self._excluded_users = excluded_users
101-
10274
def to_dict(self, serialize=False):
10375
"""Returns the model properties as a dict"""
10476
result = {}

0 commit comments

Comments
 (0)