Skip to content

Commit 041a713

Browse files
authored
Sync latest from sdk-generator (#149)
2 parents 9c3a4b1 + 47f2016 commit 041a713

29 files changed

Lines changed: 578 additions & 82 deletions

.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ docs/AbortedMessageResponse.md
1919
docs/Any.md
2020
docs/Assertion.md
2121
docs/AssertionTupleKey.md
22+
docs/AuthErrorCode.md
2223
docs/AuthorizationModel.md
2324
docs/CheckRequest.md
2425
docs/CheckRequestTupleKey.md
@@ -37,6 +38,7 @@ docs/ExpandRequest.md
3738
docs/ExpandRequestTupleKey.md
3839
docs/ExpandResponse.md
3940
docs/FgaObject.md
41+
docs/ForbiddenResponse.md
4042
docs/GetStoreResponse.md
4143
docs/InternalErrorCode.md
4244
docs/InternalErrorMessageResponse.md
@@ -140,6 +142,7 @@ openfga_sdk/models/aborted_message_response.py
140142
openfga_sdk/models/any.py
141143
openfga_sdk/models/assertion.py
142144
openfga_sdk/models/assertion_tuple_key.py
145+
openfga_sdk/models/auth_error_code.py
143146
openfga_sdk/models/authorization_model.py
144147
openfga_sdk/models/check_request.py
145148
openfga_sdk/models/check_request_tuple_key.py
@@ -158,6 +161,7 @@ openfga_sdk/models/expand_request.py
158161
openfga_sdk/models/expand_request_tuple_key.py
159162
openfga_sdk/models/expand_response.py
160163
openfga_sdk/models/fga_object.py
164+
openfga_sdk/models/forbidden_response.py
161165
openfga_sdk/models/get_store_response.py
162166
openfga_sdk/models/internal_error_code.py
163167
openfga_sdk/models/internal_error_message_response.py

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Updated to include support for [OpenFGA 0.3.0](https://github.com/openfga/openfg
196196

197197
Changes:
198198
- [BREAKING] feat(list-objects)!: response has been changed to include the object type
199-
e.g. response that was `{"object_ids":["roadmap"]}`, will now be `{"objects":["document:roadmap"]}`
199+
e.g. response that was `{"object_ids":["roadmap"]}`, will now be `{"objects":["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"]}`
200200

201201
Fixes:
202202
- fix(models): update interfaces that had incorrectly optional fields to make them required

README.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Reads the relationship tuples stored in the database. It does not evaluate nor e
502502
body = ReadRequestTupleKey(
503503
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
504504
relation="viewer",
505-
object="document:roadmap",
505+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
506506
)
507507

508508
response = await fga_client.read(body)
@@ -518,7 +518,7 @@ response = await fga_client.read(body)
518518
# Find all relationship tuples where a certain user has a relationship as any relation to a certain document
519519
body = ReadRequestTupleKey(
520520
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
521-
object="document:roadmap",
521+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
522522
)
523523

524524
response = await fga_client.read(body)
@@ -551,7 +551,7 @@ response = await fga_client.read(body)
551551

552552
# Find all relationship tuples where any user has a relationship as any relation with a particular document
553553
body = ReadRequestTupleKey(
554-
object="document:roadmap",
554+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
555555
)
556556

557557
response = await fga_client.read(body)
@@ -597,7 +597,7 @@ body = ClientWriteRequest(
597597
ClientTuple(
598598
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
599599
relation="viewer",
600-
object="document:roadmap",
600+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
601601
condition=RelationshipCondition(
602602
name='ViewCountLessThan200',
603603
context=dict(
@@ -609,14 +609,14 @@ body = ClientWriteRequest(
609609
ClientTuple(
610610
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
611611
relation="viewer",
612-
object="document:budget",
612+
object="document:0192ab2d-d36e-7cb3-a4a8-5d1d67a300c5",
613613
),
614614
],
615615
deletes=[
616616
ClientTuple(
617617
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
618618
relation="writer",
619-
object="document:roadmap",
619+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
620620
),
621621
],
622622
)
@@ -651,12 +651,12 @@ body = ClientWriteRequest(
651651
ClientTuple(
652652
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
653653
relation="viewer",
654-
object="document:roadmap",
654+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
655655
),
656656
ClientTuple(
657657
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
658658
relation="viewer",
659-
object="document:budget",
659+
object="document:0192ab2d-d36e-7cb3-a4a8-5d1d67a300c5",
660660
condition=RelationshipCondition(
661661
name='ViewCountLessThan200',
662662
context=dict(
@@ -670,7 +670,7 @@ body = ClientWriteRequest(
670670
ClientTuple(
671671
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
672672
relation="writer",
673-
object="document:roadmap",
673+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
674674
),
675675
],
676676
)
@@ -700,7 +700,7 @@ options = {
700700
body = ClientCheckRequest(
701701
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
702702
relation="writer",
703-
object="document:roadmap",
703+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
704704
context=dict(
705705
ViewCount=100
706706
),
@@ -731,12 +731,12 @@ options = {
731731
body = [ClientCheckRequest(
732732
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
733733
relation="viewer",
734-
object="document:roadmap",
734+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
735735
contextual_tuples=[ # optional
736736
ClientTuple(
737737
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
738738
relation="editor",
739-
object="document:roadmap",
739+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
740740
),
741741
],
742742
context=dict(
@@ -745,22 +745,22 @@ body = [ClientCheckRequest(
745745
), ClientCheckRequest(
746746
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
747747
relation="admin",
748-
object="document:roadmap",
748+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
749749
contextual_tuples=[ # optional
750750
ClientTuple(
751751
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
752752
relation="editor",
753-
object="document:roadmap",
753+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
754754
),
755755
]
756756
), ClientCheckRequest(
757757
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
758758
relation="creator",
759-
object="document:roadmap",
759+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
760760
), ClientCheckRequest(
761761
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
762762
relation="deleter",
763-
object="document:roadmap",
763+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
764764
)]
765765

766766
response = await fga_client.batch_check(body, options)
@@ -769,11 +769,11 @@ response = await fga_client.batch_check(body, options)
769769
# request: {
770770
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
771771
# relation: "viewer",
772-
# object: "document:roadmap",
772+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
773773
# contextual_tuples: [{
774774
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
775775
# relation: "editor",
776-
# object: "document:roadmap"
776+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"
777777
# }],
778778
# context=dict(
779779
# ViewCount=100
@@ -784,27 +784,27 @@ response = await fga_client.batch_check(body, options)
784784
# request: {
785785
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
786786
# relation: "admin",
787-
# object: "document:roadmap",
787+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
788788
# contextual_tuples: [{
789789
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
790790
# relation: "editor",
791-
# object: "document:roadmap"
791+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"
792792
# }]
793793
# }
794794
# }, {
795795
# allowed: false,
796796
# request: {
797797
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
798798
# relation: "creator",
799-
# object: "document:roadmap",
799+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
800800
# },
801801
# error: <FgaError ...>
802802
# }, {
803803
# allowed: true,
804804
# request: {
805805
# user: "user:81684243-9356-4421-8fbf-a4f8d36aa31b",
806806
# relation: "deleter",
807-
# object: "document:roadmap",
807+
# object: "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
808808
# }},
809809
# ]
810810
```
@@ -828,11 +828,11 @@ options = {
828828
}
829829
body = ClientExpandRequest(
830830
relation="viewer",
831-
object="document:roadmap",
831+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
832832
)
833833

834834
response = await fga_client.expand(body. options)
835-
# response = ExpandResponse({"tree": UsersetTree({"root": Node({"name": "document:roadmap#viewer", "leaf": Leaf({"users": Users({"users": ["user:81684243-9356-4421-8fbf-a4f8d36aa31b", "user:f52a4f7a-054d-47ff-bb6e-3ac81269988f"]})})})})})
835+
# response = ExpandResponse({"tree": UsersetTree({"root": Node({"name": "document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a#viewer", "leaf": Leaf({"users": Users({"users": ["user:81684243-9356-4421-8fbf-a4f8d36aa31b", "user:f52a4f7a-054d-47ff-bb6e-3ac81269988f"]})})})})})
836836
```
837837

838838
#### List Objects
@@ -860,7 +860,7 @@ body = ClientListObjectsRequest(
860860
ClientTuple(
861861
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
862862
relation="writer",
863-
object="document:budget",
863+
object="document:0192ab2d-d36e-7cb3-a4a8-5d1d67a300c5",
864864
),
865865
],
866866
context=dict(
@@ -869,7 +869,7 @@ body = ClientListObjectsRequest(
869869
)
870870

871871
response = await fga_client.list_objects(body)
872-
# response.objects = ["document:roadmap"]
872+
# response.objects = ["document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a"]
873873
```
874874

875875
#### List Relations
@@ -889,13 +889,13 @@ options = {
889889
}
890890
body = ClientListRelationsRequest(
891891
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
892-
object="document:roadmap",
892+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
893893
relations=["can_view", "can_edit", "can_delete", "can_rename"],
894894
contextual_tuples=[ # optional
895895
ClientTuple(
896896
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
897897
relation="writer",
898-
object="document:budget",
898+
object="document:0192ab2d-d36e-7cb3-a4a8-5d1d67a300c5",
899899
),
900900
],
901901
context=dict(
@@ -946,7 +946,7 @@ async with OpenFgaClient(configuration) as api_client:
946946
ClientTuple(
947947
user="folder:product",
948948
relation="parent",
949-
object="document:roadmap",
949+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
950950
),
951951
],
952952
)
@@ -999,7 +999,7 @@ options = {
999999
body = [ClientAssertion(
10001000
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
10011001
relation="viewer",
1002-
object="document:roadmap",
1002+
object="document:0192ab2a-d83f-756d-9397-c5ed9f3cb69a",
10031003
expectation=True,
10041004
)]
10051005

@@ -1064,6 +1064,7 @@ Class | Method | HTTP request | Description
10641064
- [Any](https://github.com/openfga/python-sdk/blob/main/docs/Any.md)
10651065
- [Assertion](https://github.com/openfga/python-sdk/blob/main/docs/Assertion.md)
10661066
- [AssertionTupleKey](https://github.com/openfga/python-sdk/blob/main/docs/AssertionTupleKey.md)
1067+
- [AuthErrorCode](https://github.com/openfga/python-sdk/blob/main/docs/AuthErrorCode.md)
10671068
- [AuthorizationModel](https://github.com/openfga/python-sdk/blob/main/docs/AuthorizationModel.md)
10681069
- [CheckRequest](https://github.com/openfga/python-sdk/blob/main/docs/CheckRequest.md)
10691070
- [CheckRequestTupleKey](https://github.com/openfga/python-sdk/blob/main/docs/CheckRequestTupleKey.md)
@@ -1082,6 +1083,7 @@ Class | Method | HTTP request | Description
10821083
- [ExpandRequestTupleKey](https://github.com/openfga/python-sdk/blob/main/docs/ExpandRequestTupleKey.md)
10831084
- [ExpandResponse](https://github.com/openfga/python-sdk/blob/main/docs/ExpandResponse.md)
10841085
- [FgaObject](https://github.com/openfga/python-sdk/blob/main/docs/FgaObject.md)
1086+
- [ForbiddenResponse](https://github.com/openfga/python-sdk/blob/main/docs/ForbiddenResponse.md)
10851087
- [GetStoreResponse](https://github.com/openfga/python-sdk/blob/main/docs/GetStoreResponse.md)
10861088
- [InternalErrorCode](https://github.com/openfga/python-sdk/blob/main/docs/InternalErrorCode.md)
10871089
- [InternalErrorMessageResponse](https://github.com/openfga/python-sdk/blob/main/docs/InternalErrorMessageResponse.md)

docs/Assertion.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**tuple_key** | [**AssertionTupleKey**](AssertionTupleKey.md) | |
88
**expectation** | **bool** | |
9+
**contextual_tuples** | [**list[TupleKey]**](TupleKey.md) | | [optional]
10+
**context** | **object** | Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation. | [optional]
911

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

docs/AuthErrorCode.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# AuthErrorCode
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

docs/ConsistencyPreference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ConsistencyPreference
22

3-
- 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+
Controls the consistency preferences when calling the query APIs. - 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.
44

55
## Properties
66
Name | Type | Description | Notes

docs/ForbiddenResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ForbiddenResponse
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**code** | [**AuthErrorCode**](AuthErrorCode.md) | | [optional]
8+
**message** | **str** | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

0 commit comments

Comments
 (0)