From bda24dc8bccb7697bff2f962b5221102fa65eb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 09:55:05 +0100 Subject: [PATCH 1/6] wire up BulkCheck from ExperimentalService --- authzed/api/v1/__init__.py | 25 ++++++++++++- examples/v1/bulk_check_permissions.py | 51 +++++++++++++++++++++++++++ tests/v1_test.py | 35 ++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 examples/v1/bulk_check_permissions.py diff --git a/authzed/api/v1/__init__.py b/authzed/api/v1/__init__.py index 2a86e7c..17591a8 100644 --- a/authzed/api/v1/__init__.py +++ b/authzed/api/v1/__init__.py @@ -15,6 +15,18 @@ ZedToken, ) from authzed.api.v1.error_reason_pb2 import ErrorReason +from authzed.api.v1.experimental_service_pb2 import ( + BulkCheckPermissionPair, + BulkCheckPermissionRequest, + BulkCheckPermissionRequestItem, + BulkCheckPermissionResponse, + BulkCheckPermissionResponseItem, + BulkExportRelationshipsRequest, + BulkExportRelationshipsResponse, + BulkImportRelationshipsRequest, + BulkImportRelationshipsResponse, +) +from authzed.api.v1.experimental_service_pb2_grpc import ExperimentalServiceStub from authzed.api.v1.permission_service_pb2 import ( CheckPermissionRequest, CheckPermissionResponse, @@ -45,7 +57,7 @@ from authzed.api.v1.schema_service_pb2_grpc import SchemaServiceStub -class Client(SchemaServiceStub, PermissionsServiceStub): +class Client(SchemaServiceStub, PermissionsServiceStub, ExperimentalServiceStub): """ v1 Authzed gRPC API client. """ @@ -60,6 +72,7 @@ def __init__(self, target, credentials, options=None, compression=None): channel = channelfn(target, credentials, options, compression) SchemaServiceStub.__init__(self, channel) PermissionsServiceStub.__init__(self, channel) + ExperimentalServiceStub.__init__(self, channel) __all__ = [ @@ -100,4 +113,14 @@ def __init__(self, target, credentials, options=None, compression=None): "ReadSchemaResponse", "WriteSchemaRequest", "WriteSchemaResponse", + # Experimental Service + "BulkCheckPermissionRequest", + "BulkCheckPermissionResponse", + "BulkCheckPermissionPair", + "BulkCheckPermissionRequestItem", + "BulkCheckPermissionResponseItem", + "BulkImportRelationshipsRequest", + "BulkImportRelationshipsResponse", + "BulkExportRelationshipsRequest", + "BulkExportRelationshipsResponse", ] diff --git a/examples/v1/bulk_check_permissions.py b/examples/v1/bulk_check_permissions.py new file mode 100644 index 0000000..8576c10 --- /dev/null +++ b/examples/v1/bulk_check_permissions.py @@ -0,0 +1,51 @@ +from authzed.api.v1 import ( + BulkCheckPermissionRequest, + BulkCheckPermissionRequestItem, + CheckPermissionResponse, + Client, + Consistency, + ObjectReference, + SubjectReference, +) +from grpcutil import bearer_token_credentials + +emilia = SubjectReference( + object=ObjectReference( + object_type="blog/user", + object_id="emilia", + ) +) +beatrice = SubjectReference( + object=ObjectReference( + object_type="blog/user", + object_id="beatrice", + ) +) + +post_one = ObjectReference(object_type="blog/post", object_id="1") + +client = Client( + "grpc.authzed.com:443", + bearer_token_credentials("t_your_token_here_1234567deadbeef"), +) + +resp = client.BulkCheckPermission( + BulkCheckPermissionRequest( + consistency=Consistency(fully_consistent=True), + items=[ + BulkCheckPermissionRequestItem( + resource=post_one, + permission="view", + subject=beatrice, + ), + BulkCheckPermissionRequestItem( + resource=post_one, + permission="write", + subject=beatrice, + ), + ], + ) +) +assert len(resp.pairs) == 2 +assert resp.pairs[0].item.permissionship == CheckPermissionResponse.PERMISSIONSHIP_HAS_PERMISSION +assert resp.pairs[1].item.permissionship == CheckPermissionResponse.PERMISSIONSHIP_HAS_PERMISSION diff --git a/tests/v1_test.py b/tests/v1_test.py index 1a60a83..71273b4 100644 --- a/tests/v1_test.py +++ b/tests/v1_test.py @@ -4,6 +4,8 @@ from google.protobuf.struct_pb2 import Struct from authzed.api.v1 import ( + BulkCheckPermissionRequest, + BulkCheckPermissionRequestItem, CheckPermissionRequest, CheckPermissionResponse, Client, @@ -184,6 +186,39 @@ def test_lookup_subjects(client): assert responses.count(beatrice.object.object_id) == 1 +def test_bulk_check(client): + # Write a basic schema. + write_test_schema(client) + beatrice, emilia, post_one, post_two = write_test_tuples(client) + + # Issue some checks. + resp = client.BulkCheckPermission( + BulkCheckPermissionRequest( + consistency=Consistency(fully_consistent=True), + items=[ + BulkCheckPermissionRequestItem( + resource=post_one, + permission="view", + subject=emilia, + ), + BulkCheckPermissionRequestItem( + resource=post_one, + permission="write", + subject=emilia, + ), + ], + ) + ) + + assert len(resp.pairs) == 2 + assert ( + resp.pairs[0].item.permissionship == CheckPermissionResponse.PERMISSIONSHIP_HAS_PERMISSION + ) + assert ( + resp.pairs[1].item.permissionship == CheckPermissionResponse.PERMISSIONSHIP_HAS_PERMISSION + ) + + def write_test_tuples(client): emilia = SubjectReference( object=ObjectReference( From b91ca30b146d5365222525ff8de4f813462081d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 09:58:46 +0100 Subject: [PATCH 2/6] generate proto/grpc using v1.25.0 API release - removes the unimplemented StreamingBulkCheckPermission API - increases Schema size to 4MB --- authzed/api/v0/core_pb2.py | 41 ++-- authzed/api/v0/developer_pb2.py | 5 +- authzed/api/v1/core_pb2.py | 77 +++--- authzed/api/v1/debug_pb2.py | 25 +- authzed/api/v1/error_reason_pb2.py | 5 +- authzed/api/v1/experimental_service_pb2.py | 115 ++++----- authzed/api/v1/experimental_service_pb2.pyi | 40 ---- .../api/v1/experimental_service_pb2_grpc.py | 33 --- .../api/v1/experimental_service_pb2_grpc.pyi | 10 - authzed/api/v1/openapi_pb2.py | 5 +- authzed/api/v1/permission_service_pb2.py | 225 +++++++++--------- authzed/api/v1/schema_service_pb2.py | 37 ++- authzed/api/v1/schema_service_pb2.pyi | 2 +- authzed/api/v1/watch_service_pb2.py | 13 +- authzed/api/v1alpha1/schema_pb2.py | 13 +- .../v1alpha1/watchresources_service_pb2.py | 17 +- buf.gen.yaml | 2 +- 17 files changed, 279 insertions(+), 386 deletions(-) diff --git a/authzed/api/v0/core_pb2.py b/authzed/api/v0/core_pb2.py index b5c235c..08e172b 100644 --- a/authzed/api/v0/core_pb2.py +++ b/authzed/api/v0/core_pb2.py @@ -20,27 +20,26 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v0.core_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v0Z2github.com/authzed/authzed-go/proto/authzed/api/v0' - _RELATIONTUPLE.fields_by_name['object_and_relation']._options = None - _RELATIONTUPLE.fields_by_name['object_and_relation']._serialized_options = b'\372B\005\212\001\002\020\001' - _RELATIONTUPLE.fields_by_name['user']._options = None - _RELATIONTUPLE.fields_by_name['user']._serialized_options = b'\372B\005\212\001\002\020\001' - _OBJECTANDRELATION.fields_by_name['namespace']._options = None - _OBJECTANDRELATION.fields_by_name['namespace']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _OBJECTANDRELATION.fields_by_name['object_id']._options = None - _OBJECTANDRELATION.fields_by_name['object_id']._serialized_options = b'\372B2r0(\200\0012+^(([a-zA-Z0-9_][a-zA-Z0-9/_|-]{0,127})|\\*)$' - _OBJECTANDRELATION.fields_by_name['relation']._options = None - _OBJECTANDRELATION.fields_by_name['relation']._serialized_options = b'\372B-r+(@2\'^(\\.\\.\\.|[a-z][a-z0-9_]{1,62}[a-z0-9])$' - _RELATIONREFERENCE.fields_by_name['namespace']._options = None - _RELATIONREFERENCE.fields_by_name['namespace']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _RELATIONREFERENCE.fields_by_name['relation']._options = None - _RELATIONREFERENCE.fields_by_name['relation']._serialized_options = b'\372B-r+(@2\'^(\\.\\.\\.|[a-z][a-z0-9_]{1,62}[a-z0-9])$' - _USER.oneofs_by_name['user_oneof']._options = None - _USER.oneofs_by_name['user_oneof']._serialized_options = b'\370B\001' - _USER.fields_by_name['userset']._options = None - _USER.fields_by_name['userset']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v0Z2github.com/authzed/authzed-go/proto/authzed/api/v0' + _globals['_RELATIONTUPLE'].fields_by_name['object_and_relation']._options = None + _globals['_RELATIONTUPLE'].fields_by_name['object_and_relation']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_RELATIONTUPLE'].fields_by_name['user']._options = None + _globals['_RELATIONTUPLE'].fields_by_name['user']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_OBJECTANDRELATION'].fields_by_name['namespace']._options = None + _globals['_OBJECTANDRELATION'].fields_by_name['namespace']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_OBJECTANDRELATION'].fields_by_name['object_id']._options = None + _globals['_OBJECTANDRELATION'].fields_by_name['object_id']._serialized_options = b'\372B2r0(\200\0012+^(([a-zA-Z0-9_][a-zA-Z0-9/_|-]{0,127})|\\*)$' + _globals['_OBJECTANDRELATION'].fields_by_name['relation']._options = None + _globals['_OBJECTANDRELATION'].fields_by_name['relation']._serialized_options = b'\372B-r+(@2\'^(\\.\\.\\.|[a-z][a-z0-9_]{1,62}[a-z0-9])$' + _globals['_RELATIONREFERENCE'].fields_by_name['namespace']._options = None + _globals['_RELATIONREFERENCE'].fields_by_name['namespace']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_RELATIONREFERENCE'].fields_by_name['relation']._options = None + _globals['_RELATIONREFERENCE'].fields_by_name['relation']._serialized_options = b'\372B-r+(@2\'^(\\.\\.\\.|[a-z][a-z0-9_]{1,62}[a-z0-9])$' + _globals['_USER'].oneofs_by_name['user_oneof']._options = None + _globals['_USER'].oneofs_by_name['user_oneof']._serialized_options = b'\370B\001' + _globals['_USER'].fields_by_name['userset']._options = None + _globals['_USER'].fields_by_name['userset']._serialized_options = b'\372B\005\212\001\002\020\001' _globals['_RELATIONTUPLE']._serialized_start=71 _globals['_RELATIONTUPLE']._serialized_end=231 _globals['_OBJECTANDRELATION']._serialized_start=234 diff --git a/authzed/api/v0/developer_pb2.py b/authzed/api/v0/developer_pb2.py index d665519..673964e 100644 --- a/authzed/api/v0/developer_pb2.py +++ b/authzed/api/v0/developer_pb2.py @@ -20,9 +20,8 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v0.developer_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v0Z2github.com/authzed/authzed-go/proto/authzed/api/v0' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v0Z2github.com/authzed/authzed-go/proto/authzed/api/v0' _globals['_FORMATSCHEMAREQUEST']._serialized_start=77 _globals['_FORMATSCHEMAREQUEST']._serialized_end=122 _globals['_FORMATSCHEMARESPONSE']._serialized_start=124 diff --git a/authzed/api/v1/core_pb2.py b/authzed/api/v1/core_pb2.py index 8682bed..0a1205b 100644 --- a/authzed/api/v1/core_pb2.py +++ b/authzed/api/v1/core_pb2.py @@ -21,45 +21,44 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.core_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _RELATIONSHIP.fields_by_name['resource']._options = None - _RELATIONSHIP.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _RELATIONSHIP.fields_by_name['relation']._options = None - _RELATIONSHIP.fields_by_name['relation']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _RELATIONSHIP.fields_by_name['subject']._options = None - _RELATIONSHIP.fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' - _RELATIONSHIP.fields_by_name['optional_caveat']._options = None - _RELATIONSHIP.fields_by_name['optional_caveat']._serialized_options = b'\372B\005\212\001\002\020\000' - _CONTEXTUALIZEDCAVEAT.fields_by_name['caveat_name']._options = None - _CONTEXTUALIZEDCAVEAT.fields_by_name['caveat_name']._serialized_options = b'\372B-r+(\200\0012&^([a-zA-Z0-9_][a-zA-Z0-9/_|-]{0,127})$' - _CONTEXTUALIZEDCAVEAT.fields_by_name['context']._options = None - _CONTEXTUALIZEDCAVEAT.fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' - _SUBJECTREFERENCE.fields_by_name['object']._options = None - _SUBJECTREFERENCE.fields_by_name['object']._serialized_options = b'\372B\005\212\001\002\020\001' - _SUBJECTREFERENCE.fields_by_name['optional_relation']._options = None - _SUBJECTREFERENCE.fields_by_name['optional_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _OBJECTREFERENCE.fields_by_name['object_type']._options = None - _OBJECTREFERENCE.fields_by_name['object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _OBJECTREFERENCE.fields_by_name['object_id']._options = None - _OBJECTREFERENCE.fields_by_name['object_id']._serialized_options = b'\372B&r$(\200\0102\037^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)$' - _ZEDTOKEN.fields_by_name['token']._options = None - _ZEDTOKEN.fields_by_name['token']._serialized_options = b'\372B\004r\002 \001' - _CURSOR.fields_by_name['token']._options = None - _CURSOR.fields_by_name['token']._serialized_options = b'\372B\010r\006 \001(\200\240\006' - _RELATIONSHIPUPDATE.fields_by_name['operation']._options = None - _RELATIONSHIPUPDATE.fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _RELATIONSHIPUPDATE.fields_by_name['relationship']._options = None - _RELATIONSHIPUPDATE.fields_by_name['relationship']._serialized_options = b'\372B\005\212\001\002\020\001' - _PERMISSIONRELATIONSHIPTREE.oneofs_by_name['tree_type']._options = None - _PERMISSIONRELATIONSHIPTREE.oneofs_by_name['tree_type']._serialized_options = b'\370B\001' - _ALGEBRAICSUBJECTSET.fields_by_name['operation']._options = None - _ALGEBRAICSUBJECTSET.fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _ALGEBRAICSUBJECTSET.fields_by_name['children']._options = None - _ALGEBRAICSUBJECTSET.fields_by_name['children']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _PARTIALCAVEATINFO.fields_by_name['missing_required_context']._options = None - _PARTIALCAVEATINFO.fields_by_name['missing_required_context']._serialized_options = b'\372B\005\222\001\002\010\001' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_RELATIONSHIP'].fields_by_name['resource']._options = None + _globals['_RELATIONSHIP'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_RELATIONSHIP'].fields_by_name['relation']._options = None + _globals['_RELATIONSHIP'].fields_by_name['relation']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_RELATIONSHIP'].fields_by_name['subject']._options = None + _globals['_RELATIONSHIP'].fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_RELATIONSHIP'].fields_by_name['optional_caveat']._options = None + _globals['_RELATIONSHIP'].fields_by_name['optional_caveat']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_CONTEXTUALIZEDCAVEAT'].fields_by_name['caveat_name']._options = None + _globals['_CONTEXTUALIZEDCAVEAT'].fields_by_name['caveat_name']._serialized_options = b'\372B-r+(\200\0012&^([a-zA-Z0-9_][a-zA-Z0-9/_|-]{0,127})$' + _globals['_CONTEXTUALIZEDCAVEAT'].fields_by_name['context']._options = None + _globals['_CONTEXTUALIZEDCAVEAT'].fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_SUBJECTREFERENCE'].fields_by_name['object']._options = None + _globals['_SUBJECTREFERENCE'].fields_by_name['object']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_SUBJECTREFERENCE'].fields_by_name['optional_relation']._options = None + _globals['_SUBJECTREFERENCE'].fields_by_name['optional_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_OBJECTREFERENCE'].fields_by_name['object_type']._options = None + _globals['_OBJECTREFERENCE'].fields_by_name['object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_OBJECTREFERENCE'].fields_by_name['object_id']._options = None + _globals['_OBJECTREFERENCE'].fields_by_name['object_id']._serialized_options = b'\372B&r$(\200\0102\037^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)$' + _globals['_ZEDTOKEN'].fields_by_name['token']._options = None + _globals['_ZEDTOKEN'].fields_by_name['token']._serialized_options = b'\372B\004r\002 \001' + _globals['_CURSOR'].fields_by_name['token']._options = None + _globals['_CURSOR'].fields_by_name['token']._serialized_options = b'\372B\010r\006 \001(\200\240\006' + _globals['_RELATIONSHIPUPDATE'].fields_by_name['operation']._options = None + _globals['_RELATIONSHIPUPDATE'].fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_RELATIONSHIPUPDATE'].fields_by_name['relationship']._options = None + _globals['_RELATIONSHIPUPDATE'].fields_by_name['relationship']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_PERMISSIONRELATIONSHIPTREE'].oneofs_by_name['tree_type']._options = None + _globals['_PERMISSIONRELATIONSHIPTREE'].oneofs_by_name['tree_type']._serialized_options = b'\370B\001' + _globals['_ALGEBRAICSUBJECTSET'].fields_by_name['operation']._options = None + _globals['_ALGEBRAICSUBJECTSET'].fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_ALGEBRAICSUBJECTSET'].fields_by_name['children']._options = None + _globals['_ALGEBRAICSUBJECTSET'].fields_by_name['children']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_PARTIALCAVEATINFO'].fields_by_name['missing_required_context']._options = None + _globals['_PARTIALCAVEATINFO'].fields_by_name['missing_required_context']._serialized_options = b'\372B\005\222\001\002\010\001' _globals['_RELATIONSHIP']._serialized_start=101 _globals['_RELATIONSHIP']._serialized_end=414 _globals['_CONTEXTUALIZEDCAVEAT']._serialized_start=417 diff --git a/authzed/api/v1/debug_pb2.py b/authzed/api/v1/debug_pb2.py index 04955a0..4ce0628 100644 --- a/authzed/api/v1/debug_pb2.py +++ b/authzed/api/v1/debug_pb2.py @@ -23,19 +23,18 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.debug_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _CHECKDEBUGTRACE.oneofs_by_name['resolution']._options = None - _CHECKDEBUGTRACE.oneofs_by_name['resolution']._serialized_options = b'\370B\001' - _CHECKDEBUGTRACE.fields_by_name['resource']._options = None - _CHECKDEBUGTRACE.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _CHECKDEBUGTRACE.fields_by_name['permission_type']._options = None - _CHECKDEBUGTRACE.fields_by_name['permission_type']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _CHECKDEBUGTRACE.fields_by_name['subject']._options = None - _CHECKDEBUGTRACE.fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' - _CHECKDEBUGTRACE.fields_by_name['result']._options = None - _CHECKDEBUGTRACE.fields_by_name['result']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_CHECKDEBUGTRACE'].oneofs_by_name['resolution']._options = None + _globals['_CHECKDEBUGTRACE'].oneofs_by_name['resolution']._serialized_options = b'\370B\001' + _globals['_CHECKDEBUGTRACE'].fields_by_name['resource']._options = None + _globals['_CHECKDEBUGTRACE'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_CHECKDEBUGTRACE'].fields_by_name['permission_type']._options = None + _globals['_CHECKDEBUGTRACE'].fields_by_name['permission_type']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_CHECKDEBUGTRACE'].fields_by_name['subject']._options = None + _globals['_CHECKDEBUGTRACE'].fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_CHECKDEBUGTRACE'].fields_by_name['result']._options = None + _globals['_CHECKDEBUGTRACE'].fields_by_name['result']._serialized_options = b'\372B\007\202\001\004\020\001 \000' _globals['_DEBUGINFORMATION']._serialized_start=160 _globals['_DEBUGINFORMATION']._serialized_end=266 _globals['_CHECKDEBUGTRACE']._serialized_start=269 diff --git a/authzed/api/v1/error_reason_pb2.py b/authzed/api/v1/error_reason_pb2.py index 0de25ce..add6341 100644 --- a/authzed/api/v1/error_reason_pb2.py +++ b/authzed/api/v1/error_reason_pb2.py @@ -19,9 +19,8 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.error_reason_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' _globals['_ERRORREASON']._serialized_start=54 _globals['_ERRORREASON']._serialized_end=934 # @@protoc_insertion_point(module_scope) diff --git a/authzed/api/v1/experimental_service_pb2.py b/authzed/api/v1/experimental_service_pb2.py index 7f59784..b3ab23e 100644 --- a/authzed/api/v1/experimental_service_pb2.py +++ b/authzed/api/v1/experimental_service_pb2.py @@ -19,73 +19,60 @@ from authzed.api.v1 import permission_service_pb2 as authzed_dot_api_dot_v1_dot_permission__service__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)authzed/api/v1/experimental_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/rpc/status.proto\x1a\x19\x61uthzed/api/v1/core.proto\x1a\'authzed/api/v1/permission_service.proto\"\xb9\x01\n#StreamingBulkCheckPermissionRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12S\n\x05items\x18\x02 \x03(\x0b\x32..authzed.api.v1.BulkCheckPermissionRequestItemB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05items\"\xb0\x01\n\x1a\x42ulkCheckPermissionRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12S\n\x05items\x18\x02 \x03(\x0b\x32..authzed.api.v1.BulkCheckPermissionRequestItemB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05items\"\xb6\x02\n\x1e\x42ulkCheckPermissionRequestItem\x12\x45\n\x08resource\x18\x01 \x01(\x0b\x32\x1f.authzed.api.v1.ObjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08resource\x12J\n\npermission\x18\x02 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\npermission\x12\x44\n\x07subject\x18\x03 \x01(\x0b\x32 .authzed.api.v1.SubjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07subject\x12;\n\x07\x63ontext\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x07\x63ontext\"\xae\x01\n\x1b\x42ulkCheckPermissionResponse\x12\x41\n\nchecked_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\tcheckedAt\x12L\n\x05pairs\x18\x02 \x03(\x0b\x32\'.authzed.api.v1.BulkCheckPermissionPairB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05pairs\"\xb7\x01\n$StreamingBulkCheckPermissionResponse\x12\x41\n\nchecked_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\tcheckedAt\x12L\n\x05pairs\x18\x02 \x03(\x0b\x32\'.authzed.api.v1.BulkCheckPermissionPairB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05pairs\"\xe2\x01\n\x17\x42ulkCheckPermissionPair\x12H\n\x07request\x18\x01 \x01(\x0b\x32..authzed.api.v1.BulkCheckPermissionRequestItemR\x07request\x12\x45\n\x04item\x18\x02 \x01(\x0b\x32/.authzed.api.v1.BulkCheckPermissionResponseItemH\x00R\x04item\x12*\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00R\x05\x65rrorB\n\n\x08response\"\xea\x01\n\x1f\x42ulkCheckPermissionResponseItem\x12j\n\x0epermissionship\x18\x01 \x01(\x0e\x32\x36.authzed.api.v1.CheckPermissionResponse.PermissionshipB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12[\n\x13partial_caveat_info\x18\x02 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo\"s\n\x1e\x42ulkImportRelationshipsRequest\x12Q\n\rrelationships\x18\x01 \x03(\x0b\x32\x1c.authzed.api.v1.RelationshipB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\rrelationships\"@\n\x1f\x42ulkImportRelationshipsResponse\x12\x1d\n\nnum_loaded\x18\x01 \x01(\x04R\tnumLoaded\"\xd3\x01\n\x1e\x42ulkExportRelationshipsRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12\x31\n\x0eoptional_limit\x18\x02 \x01(\rB\n\xfa\x42\x07*\x05\x18\x90N(\x00R\roptionalLimit\x12?\n\x0foptional_cursor\x18\x03 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x0eoptionalCursor\"\xad\x01\n\x1f\x42ulkExportRelationshipsResponse\x12\x46\n\x13\x61\x66ter_result_cursor\x18\x01 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x11\x61\x66terResultCursor\x12\x42\n\rrelationships\x18\x02 \x03(\x0b\x32\x1c.authzed.api.v1.RelationshipR\rrelationships2\x81\x06\n\x13\x45xperimentalService\x12\xb2\x01\n\x17\x42ulkImportRelationships\x12..authzed.api.v1.BulkImportRelationshipsRequest\x1a/.authzed.api.v1.BulkImportRelationshipsResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/experimental/relationships/bulkimport:\x01*(\x01\x12\xb2\x01\n\x17\x42ulkExportRelationships\x12..authzed.api.v1.BulkExportRelationshipsRequest\x1a/.authzed.api.v1.BulkExportRelationshipsResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/experimental/relationships/bulkexport:\x01*0\x01\x12\xd1\x01\n\x1cStreamingBulkCheckPermission\x12\x33.authzed.api.v1.StreamingBulkCheckPermissionRequest\x1a\x34.authzed.api.v1.StreamingBulkCheckPermissionResponse\"D\x82\xd3\xe4\x93\x02>\"9/v1/experimental/permissions/streamingbulkcheckpermission:\x01*0\x01\x12\xab\x01\n\x13\x42ulkCheckPermission\x12*.authzed.api.v1.BulkCheckPermissionRequest\x1a+.authzed.api.v1.BulkCheckPermissionResponse\";\x82\xd3\xe4\x93\x02\x35\"0/v1/experimental/permissions/bulkcheckpermission:\x01*BH\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)authzed/api/v1/experimental_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/rpc/status.proto\x1a\x19\x61uthzed/api/v1/core.proto\x1a\'authzed/api/v1/permission_service.proto\"\xb0\x01\n\x1a\x42ulkCheckPermissionRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12S\n\x05items\x18\x02 \x03(\x0b\x32..authzed.api.v1.BulkCheckPermissionRequestItemB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05items\"\xb6\x02\n\x1e\x42ulkCheckPermissionRequestItem\x12\x45\n\x08resource\x18\x01 \x01(\x0b\x32\x1f.authzed.api.v1.ObjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x08resource\x12J\n\npermission\x18\x02 \x01(\tB*\xfa\x42\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$R\npermission\x12\x44\n\x07subject\x18\x03 \x01(\x0b\x32 .authzed.api.v1.SubjectReferenceB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x07subject\x12;\n\x07\x63ontext\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x07\x63ontext\"\xae\x01\n\x1b\x42ulkCheckPermissionResponse\x12\x41\n\nchecked_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\tcheckedAt\x12L\n\x05pairs\x18\x02 \x03(\x0b\x32\'.authzed.api.v1.BulkCheckPermissionPairB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\x05pairs\"\xe2\x01\n\x17\x42ulkCheckPermissionPair\x12H\n\x07request\x18\x01 \x01(\x0b\x32..authzed.api.v1.BulkCheckPermissionRequestItemR\x07request\x12\x45\n\x04item\x18\x02 \x01(\x0b\x32/.authzed.api.v1.BulkCheckPermissionResponseItemH\x00R\x04item\x12*\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusH\x00R\x05\x65rrorB\n\n\x08response\"\xea\x01\n\x1f\x42ulkCheckPermissionResponseItem\x12j\n\x0epermissionship\x18\x01 \x01(\x0e\x32\x36.authzed.api.v1.CheckPermissionResponse.PermissionshipB\n\xfa\x42\x07\x82\x01\x04\x10\x01 \x00R\x0epermissionship\x12[\n\x13partial_caveat_info\x18\x02 \x01(\x0b\x32!.authzed.api.v1.PartialCaveatInfoB\x08\xfa\x42\x05\x8a\x01\x02\x10\x00R\x11partialCaveatInfo\"s\n\x1e\x42ulkImportRelationshipsRequest\x12Q\n\rrelationships\x18\x01 \x03(\x0b\x32\x1c.authzed.api.v1.RelationshipB\r\xfa\x42\n\x92\x01\x07\"\x05\x8a\x01\x02\x10\x01R\rrelationships\"@\n\x1f\x42ulkImportRelationshipsResponse\x12\x1d\n\nnum_loaded\x18\x01 \x01(\x04R\tnumLoaded\"\xd3\x01\n\x1e\x42ulkExportRelationshipsRequest\x12=\n\x0b\x63onsistency\x18\x01 \x01(\x0b\x32\x1b.authzed.api.v1.ConsistencyR\x0b\x63onsistency\x12\x31\n\x0eoptional_limit\x18\x02 \x01(\rB\n\xfa\x42\x07*\x05\x18\x90N(\x00R\roptionalLimit\x12?\n\x0foptional_cursor\x18\x03 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x0eoptionalCursor\"\xad\x01\n\x1f\x42ulkExportRelationshipsResponse\x12\x46\n\x13\x61\x66ter_result_cursor\x18\x01 \x01(\x0b\x32\x16.authzed.api.v1.CursorR\x11\x61\x66terResultCursor\x12\x42\n\rrelationships\x18\x02 \x03(\x0b\x32\x1c.authzed.api.v1.RelationshipR\rrelationships2\xad\x04\n\x13\x45xperimentalService\x12\xb2\x01\n\x17\x42ulkImportRelationships\x12..authzed.api.v1.BulkImportRelationshipsRequest\x1a/.authzed.api.v1.BulkImportRelationshipsResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/experimental/relationships/bulkimport:\x01*(\x01\x12\xb2\x01\n\x17\x42ulkExportRelationships\x12..authzed.api.v1.BulkExportRelationshipsRequest\x1a/.authzed.api.v1.BulkExportRelationshipsResponse\"4\x82\xd3\xe4\x93\x02.\")/v1/experimental/relationships/bulkexport:\x01*0\x01\x12\xab\x01\n\x13\x42ulkCheckPermission\x12*.authzed.api.v1.BulkCheckPermissionRequest\x1a+.authzed.api.v1.BulkCheckPermissionResponse\";\x82\xd3\xe4\x93\x02\x35\"0/v1/experimental/permissions/bulkcheckpermission:\x01*BH\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.experimental_service_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _STREAMINGBULKCHECKPERMISSIONREQUEST.fields_by_name['items']._options = None - _STREAMINGBULKCHECKPERMISSIONREQUEST.fields_by_name['items']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _BULKCHECKPERMISSIONREQUEST.fields_by_name['items']._options = None - _BULKCHECKPERMISSIONREQUEST.fields_by_name['items']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['resource']._options = None - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['permission']._options = None - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['subject']._options = None - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['context']._options = None - _BULKCHECKPERMISSIONREQUESTITEM.fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' - _BULKCHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._options = None - _BULKCHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._serialized_options = b'\372B\005\212\001\002\020\000' - _BULKCHECKPERMISSIONRESPONSE.fields_by_name['pairs']._options = None - _BULKCHECKPERMISSIONRESPONSE.fields_by_name['pairs']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _STREAMINGBULKCHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._options = None - _STREAMINGBULKCHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._serialized_options = b'\372B\005\212\001\002\020\000' - _STREAMINGBULKCHECKPERMISSIONRESPONSE.fields_by_name['pairs']._options = None - _STREAMINGBULKCHECKPERMISSIONRESPONSE.fields_by_name['pairs']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _BULKCHECKPERMISSIONRESPONSEITEM.fields_by_name['permissionship']._options = None - _BULKCHECKPERMISSIONRESPONSEITEM.fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _BULKCHECKPERMISSIONRESPONSEITEM.fields_by_name['partial_caveat_info']._options = None - _BULKCHECKPERMISSIONRESPONSEITEM.fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' - _BULKIMPORTRELATIONSHIPSREQUEST.fields_by_name['relationships']._options = None - _BULKIMPORTRELATIONSHIPSREQUEST.fields_by_name['relationships']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _BULKEXPORTRELATIONSHIPSREQUEST.fields_by_name['optional_limit']._options = None - _BULKEXPORTRELATIONSHIPSREQUEST.fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\220N(\000' - _EXPERIMENTALSERVICE.methods_by_name['BulkImportRelationships']._options = None - _EXPERIMENTALSERVICE.methods_by_name['BulkImportRelationships']._serialized_options = b'\202\323\344\223\002.\")/v1/experimental/relationships/bulkimport:\001*' - _EXPERIMENTALSERVICE.methods_by_name['BulkExportRelationships']._options = None - _EXPERIMENTALSERVICE.methods_by_name['BulkExportRelationships']._serialized_options = b'\202\323\344\223\002.\")/v1/experimental/relationships/bulkexport:\001*' - _EXPERIMENTALSERVICE.methods_by_name['StreamingBulkCheckPermission']._options = None - _EXPERIMENTALSERVICE.methods_by_name['StreamingBulkCheckPermission']._serialized_options = b'\202\323\344\223\002>\"9/v1/experimental/permissions/streamingbulkcheckpermission:\001*' - _EXPERIMENTALSERVICE.methods_by_name['BulkCheckPermission']._options = None - _EXPERIMENTALSERVICE.methods_by_name['BulkCheckPermission']._serialized_options = b'\202\323\344\223\0025\"0/v1/experimental/permissions/bulkcheckpermission:\001*' - _globals['_STREAMINGBULKCHECKPERMISSIONREQUEST']._serialized_start=240 - _globals['_STREAMINGBULKCHECKPERMISSIONREQUEST']._serialized_end=425 - _globals['_BULKCHECKPERMISSIONREQUEST']._serialized_start=428 - _globals['_BULKCHECKPERMISSIONREQUEST']._serialized_end=604 - _globals['_BULKCHECKPERMISSIONREQUESTITEM']._serialized_start=607 - _globals['_BULKCHECKPERMISSIONREQUESTITEM']._serialized_end=917 - _globals['_BULKCHECKPERMISSIONRESPONSE']._serialized_start=920 - _globals['_BULKCHECKPERMISSIONRESPONSE']._serialized_end=1094 - _globals['_STREAMINGBULKCHECKPERMISSIONRESPONSE']._serialized_start=1097 - _globals['_STREAMINGBULKCHECKPERMISSIONRESPONSE']._serialized_end=1280 - _globals['_BULKCHECKPERMISSIONPAIR']._serialized_start=1283 - _globals['_BULKCHECKPERMISSIONPAIR']._serialized_end=1509 - _globals['_BULKCHECKPERMISSIONRESPONSEITEM']._serialized_start=1512 - _globals['_BULKCHECKPERMISSIONRESPONSEITEM']._serialized_end=1746 - _globals['_BULKIMPORTRELATIONSHIPSREQUEST']._serialized_start=1748 - _globals['_BULKIMPORTRELATIONSHIPSREQUEST']._serialized_end=1863 - _globals['_BULKIMPORTRELATIONSHIPSRESPONSE']._serialized_start=1865 - _globals['_BULKIMPORTRELATIONSHIPSRESPONSE']._serialized_end=1929 - _globals['_BULKEXPORTRELATIONSHIPSREQUEST']._serialized_start=1932 - _globals['_BULKEXPORTRELATIONSHIPSREQUEST']._serialized_end=2143 - _globals['_BULKEXPORTRELATIONSHIPSRESPONSE']._serialized_start=2146 - _globals['_BULKEXPORTRELATIONSHIPSRESPONSE']._serialized_end=2319 - _globals['_EXPERIMENTALSERVICE']._serialized_start=2322 - _globals['_EXPERIMENTALSERVICE']._serialized_end=3091 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_BULKCHECKPERMISSIONREQUEST'].fields_by_name['items']._options = None + _globals['_BULKCHECKPERMISSIONREQUEST'].fields_by_name['items']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['resource']._options = None + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['permission']._options = None + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['subject']._options = None + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['context']._options = None + _globals['_BULKCHECKPERMISSIONREQUESTITEM'].fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_BULKCHECKPERMISSIONRESPONSE'].fields_by_name['checked_at']._options = None + _globals['_BULKCHECKPERMISSIONRESPONSE'].fields_by_name['checked_at']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_BULKCHECKPERMISSIONRESPONSE'].fields_by_name['pairs']._options = None + _globals['_BULKCHECKPERMISSIONRESPONSE'].fields_by_name['pairs']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_BULKCHECKPERMISSIONRESPONSEITEM'].fields_by_name['permissionship']._options = None + _globals['_BULKCHECKPERMISSIONRESPONSEITEM'].fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_BULKCHECKPERMISSIONRESPONSEITEM'].fields_by_name['partial_caveat_info']._options = None + _globals['_BULKCHECKPERMISSIONRESPONSEITEM'].fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_BULKIMPORTRELATIONSHIPSREQUEST'].fields_by_name['relationships']._options = None + _globals['_BULKIMPORTRELATIONSHIPSREQUEST'].fields_by_name['relationships']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_BULKEXPORTRELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._options = None + _globals['_BULKEXPORTRELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\220N(\000' + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkImportRelationships']._options = None + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkImportRelationships']._serialized_options = b'\202\323\344\223\002.\")/v1/experimental/relationships/bulkimport:\001*' + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkExportRelationships']._options = None + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkExportRelationships']._serialized_options = b'\202\323\344\223\002.\")/v1/experimental/relationships/bulkexport:\001*' + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkCheckPermission']._options = None + _globals['_EXPERIMENTALSERVICE'].methods_by_name['BulkCheckPermission']._serialized_options = b'\202\323\344\223\0025\"0/v1/experimental/permissions/bulkcheckpermission:\001*' + _globals['_BULKCHECKPERMISSIONREQUEST']._serialized_start=240 + _globals['_BULKCHECKPERMISSIONREQUEST']._serialized_end=416 + _globals['_BULKCHECKPERMISSIONREQUESTITEM']._serialized_start=419 + _globals['_BULKCHECKPERMISSIONREQUESTITEM']._serialized_end=729 + _globals['_BULKCHECKPERMISSIONRESPONSE']._serialized_start=732 + _globals['_BULKCHECKPERMISSIONRESPONSE']._serialized_end=906 + _globals['_BULKCHECKPERMISSIONPAIR']._serialized_start=909 + _globals['_BULKCHECKPERMISSIONPAIR']._serialized_end=1135 + _globals['_BULKCHECKPERMISSIONRESPONSEITEM']._serialized_start=1138 + _globals['_BULKCHECKPERMISSIONRESPONSEITEM']._serialized_end=1372 + _globals['_BULKIMPORTRELATIONSHIPSREQUEST']._serialized_start=1374 + _globals['_BULKIMPORTRELATIONSHIPSREQUEST']._serialized_end=1489 + _globals['_BULKIMPORTRELATIONSHIPSRESPONSE']._serialized_start=1491 + _globals['_BULKIMPORTRELATIONSHIPSRESPONSE']._serialized_end=1555 + _globals['_BULKEXPORTRELATIONSHIPSREQUEST']._serialized_start=1558 + _globals['_BULKEXPORTRELATIONSHIPSREQUEST']._serialized_end=1769 + _globals['_BULKEXPORTRELATIONSHIPSRESPONSE']._serialized_start=1772 + _globals['_BULKEXPORTRELATIONSHIPSRESPONSE']._serialized_end=1945 + _globals['_EXPERIMENTALSERVICE']._serialized_start=1948 + _globals['_EXPERIMENTALSERVICE']._serialized_end=2505 # @@protoc_insertion_point(module_scope) diff --git a/authzed/api/v1/experimental_service_pb2.pyi b/authzed/api/v1/experimental_service_pb2.pyi index 0bc082e..72b4579 100644 --- a/authzed/api/v1/experimental_service_pb2.pyi +++ b/authzed/api/v1/experimental_service_pb2.pyi @@ -20,26 +20,6 @@ else: DESCRIPTOR: google.protobuf.descriptor.FileDescriptor -class StreamingBulkCheckPermissionRequest(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - CONSISTENCY_FIELD_NUMBER: builtins.int - ITEMS_FIELD_NUMBER: builtins.int - @property - def consistency(self) -> authzed.api.v1.permission_service_pb2.Consistency: ... - @property - def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BulkCheckPermissionRequestItem]: ... - def __init__( - self, - *, - consistency: authzed.api.v1.permission_service_pb2.Consistency | None = ..., - items: collections.abc.Iterable[global___BulkCheckPermissionRequestItem] | None = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["consistency", b"consistency"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["consistency", b"consistency", "items", b"items"]) -> None: ... - -global___StreamingBulkCheckPermissionRequest = StreamingBulkCheckPermissionRequest - class BulkCheckPermissionRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -107,26 +87,6 @@ class BulkCheckPermissionResponse(google.protobuf.message.Message): global___BulkCheckPermissionResponse = BulkCheckPermissionResponse -class StreamingBulkCheckPermissionResponse(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - CHECKED_AT_FIELD_NUMBER: builtins.int - PAIRS_FIELD_NUMBER: builtins.int - @property - def checked_at(self) -> authzed.api.v1.core_pb2.ZedToken: ... - @property - def pairs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BulkCheckPermissionPair]: ... - def __init__( - self, - *, - checked_at: authzed.api.v1.core_pb2.ZedToken | None = ..., - pairs: collections.abc.Iterable[global___BulkCheckPermissionPair] | None = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["checked_at", b"checked_at"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["checked_at", b"checked_at", "pairs", b"pairs"]) -> None: ... - -global___StreamingBulkCheckPermissionResponse = StreamingBulkCheckPermissionResponse - class BulkCheckPermissionPair(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/authzed/api/v1/experimental_service_pb2_grpc.py b/authzed/api/v1/experimental_service_pb2_grpc.py index 883a9f5..ef4ed2b 100644 --- a/authzed/api/v1/experimental_service_pb2_grpc.py +++ b/authzed/api/v1/experimental_service_pb2_grpc.py @@ -26,11 +26,6 @@ def __init__(self, channel): request_serializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkExportRelationshipsRequest.SerializeToString, response_deserializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkExportRelationshipsResponse.FromString, ) - self.StreamingBulkCheckPermission = channel.unary_stream( - '/authzed.api.v1.ExperimentalService/StreamingBulkCheckPermission', - request_serializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionRequest.SerializeToString, - response_deserializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionResponse.FromString, - ) self.BulkCheckPermission = channel.unary_unary( '/authzed.api.v1.ExperimentalService/BulkCheckPermission', request_serializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkCheckPermissionRequest.SerializeToString, @@ -67,12 +62,6 @@ def BulkExportRelationships(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def StreamingBulkCheckPermission(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def BulkCheckPermission(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -92,11 +81,6 @@ def add_ExperimentalServiceServicer_to_server(servicer, server): request_deserializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkExportRelationshipsRequest.FromString, response_serializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkExportRelationshipsResponse.SerializeToString, ), - 'StreamingBulkCheckPermission': grpc.unary_stream_rpc_method_handler( - servicer.StreamingBulkCheckPermission, - request_deserializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionRequest.FromString, - response_serializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionResponse.SerializeToString, - ), 'BulkCheckPermission': grpc.unary_unary_rpc_method_handler( servicer.BulkCheckPermission, request_deserializer=authzed_dot_api_dot_v1_dot_experimental__service__pb2.BulkCheckPermissionRequest.FromString, @@ -148,23 +132,6 @@ def BulkExportRelationships(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def StreamingBulkCheckPermission(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/authzed.api.v1.ExperimentalService/StreamingBulkCheckPermission', - authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionRequest.SerializeToString, - authzed_dot_api_dot_v1_dot_experimental__service__pb2.StreamingBulkCheckPermissionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def BulkCheckPermission(request, target, diff --git a/authzed/api/v1/experimental_service_pb2_grpc.pyi b/authzed/api/v1/experimental_service_pb2_grpc.pyi index 675a515..c446671 100644 --- a/authzed/api/v1/experimental_service_pb2_grpc.pyi +++ b/authzed/api/v1/experimental_service_pb2_grpc.pyi @@ -35,10 +35,6 @@ class ExperimentalServiceStub: relationships from the server. It is resumable, and will return results in an order determined by the server. """ - StreamingBulkCheckPermission: grpc.UnaryStreamMultiCallable[ - authzed.api.v1.experimental_service_pb2.StreamingBulkCheckPermissionRequest, - authzed.api.v1.experimental_service_pb2.StreamingBulkCheckPermissionResponse, - ] BulkCheckPermission: grpc.UnaryUnaryMultiCallable[ authzed.api.v1.experimental_service_pb2.BulkCheckPermissionRequest, authzed.api.v1.experimental_service_pb2.BulkCheckPermissionResponse, @@ -76,12 +72,6 @@ class ExperimentalServiceServicer(metaclass=abc.ABCMeta): in an order determined by the server. """ @abc.abstractmethod - def StreamingBulkCheckPermission( - self, - request: authzed.api.v1.experimental_service_pb2.StreamingBulkCheckPermissionRequest, - context: grpc.ServicerContext, - ) -> collections.abc.Iterator[authzed.api.v1.experimental_service_pb2.StreamingBulkCheckPermissionResponse]: ... - @abc.abstractmethod def BulkCheckPermission( self, request: authzed.api.v1.experimental_service_pb2.BulkCheckPermissionRequest, diff --git a/authzed/api/v1/openapi_pb2.py b/authzed/api/v1/openapi_pb2.py index 7ca3ff5..bf616fb 100644 --- a/authzed/api/v1/openapi_pb2.py +++ b/authzed/api/v1/openapi_pb2.py @@ -20,7 +20,6 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.openapi_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1\222A\264\002\022\234\001\n\007Authzed\"D\n\rAuthzed, Inc.\022\036https://github.com/authzed/api\032\023support@authzed.com*F\n\022Apache 2.0 License\0220https://github.com/authzed/api/blob/main/LICENSE2\0031.0*\003\001\002\0042\020application/json:\020application/jsonZ#\n!\n\nApiKeyAuth\022\023\010\002\032\rAuthorization \002rE\n\033More about the Authzed API.\022&https://docs.authzed.com/reference/api' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1\222A\264\002\022\234\001\n\007Authzed\"D\n\rAuthzed, Inc.\022\036https://github.com/authzed/api\032\023support@authzed.com*F\n\022Apache 2.0 License\0220https://github.com/authzed/api/blob/main/LICENSE2\0031.0*\003\001\002\0042\020application/json:\020application/jsonZ#\n!\n\nApiKeyAuth\022\023\010\002\032\rAuthorization \002rE\n\033More about the Authzed API.\022&https://docs.authzed.com/reference/api' # @@protoc_insertion_point(module_scope) diff --git a/authzed/api/v1/permission_service_pb2.py b/authzed/api/v1/permission_service_pb2.py index b18c38e..6cea460 100644 --- a/authzed/api/v1/permission_service_pb2.py +++ b/authzed/api/v1/permission_service_pb2.py @@ -23,119 +23,118 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.permission_service_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _CONSISTENCY.oneofs_by_name['requirement']._options = None - _CONSISTENCY.oneofs_by_name['requirement']._serialized_options = b'\370B\001' - _CONSISTENCY.fields_by_name['minimize_latency']._options = None - _CONSISTENCY.fields_by_name['minimize_latency']._serialized_options = b'\372B\004j\002\010\001' - _CONSISTENCY.fields_by_name['fully_consistent']._options = None - _CONSISTENCY.fields_by_name['fully_consistent']._serialized_options = b'\372B\004j\002\010\001' - _RELATIONSHIPFILTER.fields_by_name['resource_type']._options = None - _RELATIONSHIPFILTER.fields_by_name['resource_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _RELATIONSHIPFILTER.fields_by_name['optional_resource_id']._options = None - _RELATIONSHIPFILTER.fields_by_name['optional_resource_id']._serialized_options = b'\372B\"r (\200\0102\033^([a-zA-Z0-9/_|\\-=+]{1,})?$' - _RELATIONSHIPFILTER.fields_by_name['optional_relation']._options = None - _RELATIONSHIPFILTER.fields_by_name['optional_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _SUBJECTFILTER_RELATIONFILTER.fields_by_name['relation']._options = None - _SUBJECTFILTER_RELATIONFILTER.fields_by_name['relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _SUBJECTFILTER.fields_by_name['subject_type']._options = None - _SUBJECTFILTER.fields_by_name['subject_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _SUBJECTFILTER.fields_by_name['optional_subject_id']._options = None - _SUBJECTFILTER.fields_by_name['optional_subject_id']._serialized_options = b'\372B\'r%(\200\0102 ^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)?$' - _READRELATIONSHIPSREQUEST.fields_by_name['relationship_filter']._options = None - _READRELATIONSHIPSREQUEST.fields_by_name['relationship_filter']._serialized_options = b'\372B\005\212\001\002\020\001' - _READRELATIONSHIPSREQUEST.fields_by_name['optional_limit']._options = None - _READRELATIONSHIPSREQUEST.fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' - _READRELATIONSHIPSRESPONSE.fields_by_name['read_at']._options = None - _READRELATIONSHIPSRESPONSE.fields_by_name['read_at']._serialized_options = b'\372B\005\212\001\002\020\001' - _READRELATIONSHIPSRESPONSE.fields_by_name['relationship']._options = None - _READRELATIONSHIPSRESPONSE.fields_by_name['relationship']._serialized_options = b'\372B\005\212\001\002\020\001' - _PRECONDITION.fields_by_name['operation']._options = None - _PRECONDITION.fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _PRECONDITION.fields_by_name['filter']._options = None - _PRECONDITION.fields_by_name['filter']._serialized_options = b'\372B\005\212\001\002\020\001' - _WRITERELATIONSHIPSREQUEST.fields_by_name['updates']._options = None - _WRITERELATIONSHIPSREQUEST.fields_by_name['updates']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _WRITERELATIONSHIPSREQUEST.fields_by_name['optional_preconditions']._options = None - _WRITERELATIONSHIPSREQUEST.fields_by_name['optional_preconditions']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _DELETERELATIONSHIPSREQUEST.fields_by_name['relationship_filter']._options = None - _DELETERELATIONSHIPSREQUEST.fields_by_name['relationship_filter']._serialized_options = b'\372B\005\212\001\002\020\001' - _DELETERELATIONSHIPSREQUEST.fields_by_name['optional_preconditions']._options = None - _DELETERELATIONSHIPSREQUEST.fields_by_name['optional_preconditions']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' - _DELETERELATIONSHIPSREQUEST.fields_by_name['optional_limit']._options = None - _DELETERELATIONSHIPSREQUEST.fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' - _CHECKPERMISSIONREQUEST.fields_by_name['resource']._options = None - _CHECKPERMISSIONREQUEST.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _CHECKPERMISSIONREQUEST.fields_by_name['permission']._options = None - _CHECKPERMISSIONREQUEST.fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _CHECKPERMISSIONREQUEST.fields_by_name['subject']._options = None - _CHECKPERMISSIONREQUEST.fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' - _CHECKPERMISSIONREQUEST.fields_by_name['context']._options = None - _CHECKPERMISSIONREQUEST.fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' - _CHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._options = None - _CHECKPERMISSIONRESPONSE.fields_by_name['checked_at']._serialized_options = b'\372B\005\212\001\002\020\000' - _CHECKPERMISSIONRESPONSE.fields_by_name['permissionship']._options = None - _CHECKPERMISSIONRESPONSE.fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _CHECKPERMISSIONRESPONSE.fields_by_name['partial_caveat_info']._options = None - _CHECKPERMISSIONRESPONSE.fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' - _EXPANDPERMISSIONTREEREQUEST.fields_by_name['resource']._options = None - _EXPANDPERMISSIONTREEREQUEST.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _EXPANDPERMISSIONTREEREQUEST.fields_by_name['permission']._options = None - _EXPANDPERMISSIONTREEREQUEST.fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _LOOKUPRESOURCESREQUEST.fields_by_name['resource_object_type']._options = None - _LOOKUPRESOURCESREQUEST.fields_by_name['resource_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _LOOKUPRESOURCESREQUEST.fields_by_name['permission']._options = None - _LOOKUPRESOURCESREQUEST.fields_by_name['permission']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _LOOKUPRESOURCESREQUEST.fields_by_name['subject']._options = None - _LOOKUPRESOURCESREQUEST.fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' - _LOOKUPRESOURCESREQUEST.fields_by_name['context']._options = None - _LOOKUPRESOURCESREQUEST.fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' - _LOOKUPRESOURCESREQUEST.fields_by_name['optional_limit']._options = None - _LOOKUPRESOURCESREQUEST.fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' - _LOOKUPRESOURCESRESPONSE.fields_by_name['permissionship']._options = None - _LOOKUPRESOURCESRESPONSE.fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _LOOKUPRESOURCESRESPONSE.fields_by_name['partial_caveat_info']._options = None - _LOOKUPRESOURCESRESPONSE.fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' - _LOOKUPSUBJECTSREQUEST.fields_by_name['resource']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' - _LOOKUPSUBJECTSREQUEST.fields_by_name['permission']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _LOOKUPSUBJECTSREQUEST.fields_by_name['subject_object_type']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['subject_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _LOOKUPSUBJECTSREQUEST.fields_by_name['optional_subject_relation']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['optional_subject_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' - _LOOKUPSUBJECTSREQUEST.fields_by_name['context']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' - _LOOKUPSUBJECTSREQUEST.fields_by_name['optional_concrete_limit']._options = None - _LOOKUPSUBJECTSREQUEST.fields_by_name['optional_concrete_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' - _LOOKUPSUBJECTSRESPONSE.fields_by_name['subject_object_id']._options = None - _LOOKUPSUBJECTSRESPONSE.fields_by_name['subject_object_id']._serialized_options = b'\030\001' - _LOOKUPSUBJECTSRESPONSE.fields_by_name['excluded_subject_ids']._options = None - _LOOKUPSUBJECTSRESPONSE.fields_by_name['excluded_subject_ids']._serialized_options = b'\030\001' - _LOOKUPSUBJECTSRESPONSE.fields_by_name['permissionship']._options = None - _LOOKUPSUBJECTSRESPONSE.fields_by_name['permissionship']._serialized_options = b'\030\001\372B\007\202\001\004\020\001 \000' - _LOOKUPSUBJECTSRESPONSE.fields_by_name['partial_caveat_info']._options = None - _LOOKUPSUBJECTSRESPONSE.fields_by_name['partial_caveat_info']._serialized_options = b'\030\001\372B\005\212\001\002\020\000' - _RESOLVEDSUBJECT.fields_by_name['permissionship']._options = None - _RESOLVEDSUBJECT.fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' - _RESOLVEDSUBJECT.fields_by_name['partial_caveat_info']._options = None - _RESOLVEDSUBJECT.fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' - _PERMISSIONSSERVICE.methods_by_name['ReadRelationships']._options = None - _PERMISSIONSSERVICE.methods_by_name['ReadRelationships']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/relationships/read:\001*' - _PERMISSIONSSERVICE.methods_by_name['WriteRelationships']._options = None - _PERMISSIONSSERVICE.methods_by_name['WriteRelationships']._serialized_options = b'\202\323\344\223\002\034\"\027/v1/relationships/write:\001*' - _PERMISSIONSSERVICE.methods_by_name['DeleteRelationships']._options = None - _PERMISSIONSSERVICE.methods_by_name['DeleteRelationships']._serialized_options = b'\202\323\344\223\002\035\"\030/v1/relationships/delete:\001*' - _PERMISSIONSSERVICE.methods_by_name['CheckPermission']._options = None - _PERMISSIONSSERVICE.methods_by_name['CheckPermission']._serialized_options = b'\202\323\344\223\002\032\"\025/v1/permissions/check:\001*' - _PERMISSIONSSERVICE.methods_by_name['ExpandPermissionTree']._options = None - _PERMISSIONSSERVICE.methods_by_name['ExpandPermissionTree']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/permissions/expand:\001*' - _PERMISSIONSSERVICE.methods_by_name['LookupResources']._options = None - _PERMISSIONSSERVICE.methods_by_name['LookupResources']._serialized_options = b'\202\323\344\223\002\036\"\031/v1/permissions/resources:\001*' - _PERMISSIONSSERVICE.methods_by_name['LookupSubjects']._options = None - _PERMISSIONSSERVICE.methods_by_name['LookupSubjects']._serialized_options = b'\202\323\344\223\002\035\"\030/v1/permissions/subjects:\001*' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_CONSISTENCY'].oneofs_by_name['requirement']._options = None + _globals['_CONSISTENCY'].oneofs_by_name['requirement']._serialized_options = b'\370B\001' + _globals['_CONSISTENCY'].fields_by_name['minimize_latency']._options = None + _globals['_CONSISTENCY'].fields_by_name['minimize_latency']._serialized_options = b'\372B\004j\002\010\001' + _globals['_CONSISTENCY'].fields_by_name['fully_consistent']._options = None + _globals['_CONSISTENCY'].fields_by_name['fully_consistent']._serialized_options = b'\372B\004j\002\010\001' + _globals['_RELATIONSHIPFILTER'].fields_by_name['resource_type']._options = None + _globals['_RELATIONSHIPFILTER'].fields_by_name['resource_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_RELATIONSHIPFILTER'].fields_by_name['optional_resource_id']._options = None + _globals['_RELATIONSHIPFILTER'].fields_by_name['optional_resource_id']._serialized_options = b'\372B\"r (\200\0102\033^([a-zA-Z0-9/_|\\-=+]{1,})?$' + _globals['_RELATIONSHIPFILTER'].fields_by_name['optional_relation']._options = None + _globals['_RELATIONSHIPFILTER'].fields_by_name['optional_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_SUBJECTFILTER_RELATIONFILTER'].fields_by_name['relation']._options = None + _globals['_SUBJECTFILTER_RELATIONFILTER'].fields_by_name['relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_SUBJECTFILTER'].fields_by_name['subject_type']._options = None + _globals['_SUBJECTFILTER'].fields_by_name['subject_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_SUBJECTFILTER'].fields_by_name['optional_subject_id']._options = None + _globals['_SUBJECTFILTER'].fields_by_name['optional_subject_id']._serialized_options = b'\372B\'r%(\200\0102 ^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)?$' + _globals['_READRELATIONSHIPSREQUEST'].fields_by_name['relationship_filter']._options = None + _globals['_READRELATIONSHIPSREQUEST'].fields_by_name['relationship_filter']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_READRELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._options = None + _globals['_READRELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' + _globals['_READRELATIONSHIPSRESPONSE'].fields_by_name['read_at']._options = None + _globals['_READRELATIONSHIPSRESPONSE'].fields_by_name['read_at']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_READRELATIONSHIPSRESPONSE'].fields_by_name['relationship']._options = None + _globals['_READRELATIONSHIPSRESPONSE'].fields_by_name['relationship']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_PRECONDITION'].fields_by_name['operation']._options = None + _globals['_PRECONDITION'].fields_by_name['operation']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_PRECONDITION'].fields_by_name['filter']._options = None + _globals['_PRECONDITION'].fields_by_name['filter']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_WRITERELATIONSHIPSREQUEST'].fields_by_name['updates']._options = None + _globals['_WRITERELATIONSHIPSREQUEST'].fields_by_name['updates']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_WRITERELATIONSHIPSREQUEST'].fields_by_name['optional_preconditions']._options = None + _globals['_WRITERELATIONSHIPSREQUEST'].fields_by_name['optional_preconditions']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['relationship_filter']._options = None + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['relationship_filter']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['optional_preconditions']._options = None + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['optional_preconditions']._serialized_options = b'\372B\n\222\001\007\"\005\212\001\002\020\001' + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._options = None + _globals['_DELETERELATIONSHIPSREQUEST'].fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['resource']._options = None + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['permission']._options = None + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['subject']._options = None + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['context']._options = None + _globals['_CHECKPERMISSIONREQUEST'].fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['checked_at']._options = None + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['checked_at']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['permissionship']._options = None + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['partial_caveat_info']._options = None + _globals['_CHECKPERMISSIONRESPONSE'].fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_EXPANDPERMISSIONTREEREQUEST'].fields_by_name['resource']._options = None + _globals['_EXPANDPERMISSIONTREEREQUEST'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_EXPANDPERMISSIONTREEREQUEST'].fields_by_name['permission']._options = None + _globals['_EXPANDPERMISSIONTREEREQUEST'].fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['resource_object_type']._options = None + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['resource_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['permission']._options = None + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['permission']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['subject']._options = None + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['subject']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['context']._options = None + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['optional_limit']._options = None + _globals['_LOOKUPRESOURCESREQUEST'].fields_by_name['optional_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' + _globals['_LOOKUPRESOURCESRESPONSE'].fields_by_name['permissionship']._options = None + _globals['_LOOKUPRESOURCESRESPONSE'].fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_LOOKUPRESOURCESRESPONSE'].fields_by_name['partial_caveat_info']._options = None + _globals['_LOOKUPRESOURCESRESPONSE'].fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['resource']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['resource']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['permission']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['permission']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['subject_object_type']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['subject_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['optional_subject_relation']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['optional_subject_relation']._serialized_options = b'\372B\'r%(@2!^([a-z][a-z0-9_]{1,62}[a-z0-9])?$' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['context']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['context']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['optional_concrete_limit']._options = None + _globals['_LOOKUPSUBJECTSREQUEST'].fields_by_name['optional_concrete_limit']._serialized_options = b'\372B\007*\005\030\350\007(\000' + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['subject_object_id']._options = None + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['subject_object_id']._serialized_options = b'\030\001' + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['excluded_subject_ids']._options = None + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['excluded_subject_ids']._serialized_options = b'\030\001' + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['permissionship']._options = None + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['permissionship']._serialized_options = b'\030\001\372B\007\202\001\004\020\001 \000' + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['partial_caveat_info']._options = None + _globals['_LOOKUPSUBJECTSRESPONSE'].fields_by_name['partial_caveat_info']._serialized_options = b'\030\001\372B\005\212\001\002\020\000' + _globals['_RESOLVEDSUBJECT'].fields_by_name['permissionship']._options = None + _globals['_RESOLVEDSUBJECT'].fields_by_name['permissionship']._serialized_options = b'\372B\007\202\001\004\020\001 \000' + _globals['_RESOLVEDSUBJECT'].fields_by_name['partial_caveat_info']._options = None + _globals['_RESOLVEDSUBJECT'].fields_by_name['partial_caveat_info']._serialized_options = b'\372B\005\212\001\002\020\000' + _globals['_PERMISSIONSSERVICE'].methods_by_name['ReadRelationships']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['ReadRelationships']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/relationships/read:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['WriteRelationships']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['WriteRelationships']._serialized_options = b'\202\323\344\223\002\034\"\027/v1/relationships/write:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['DeleteRelationships']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['DeleteRelationships']._serialized_options = b'\202\323\344\223\002\035\"\030/v1/relationships/delete:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['CheckPermission']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['CheckPermission']._serialized_options = b'\202\323\344\223\002\032\"\025/v1/permissions/check:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['ExpandPermissionTree']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['ExpandPermissionTree']._serialized_options = b'\202\323\344\223\002\033\"\026/v1/permissions/expand:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['LookupResources']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['LookupResources']._serialized_options = b'\202\323\344\223\002\036\"\031/v1/permissions/resources:\001*' + _globals['_PERMISSIONSSERVICE'].methods_by_name['LookupSubjects']._options = None + _globals['_PERMISSIONSSERVICE'].methods_by_name['LookupSubjects']._serialized_options = b'\202\323\344\223\002\035\"\030/v1/permissions/subjects:\001*' _globals['_LOOKUPPERMISSIONSHIP']._serialized_start=6892 _globals['_LOOKUPPERMISSIONSHIP']._serialized_end=7045 _globals['_CONSISTENCY']._serialized_start=172 diff --git a/authzed/api/v1/schema_service_pb2.py b/authzed/api/v1/schema_service_pb2.py index 83bc1b9..83e1005 100644 --- a/authzed/api/v1/schema_service_pb2.py +++ b/authzed/api/v1/schema_service_pb2.py @@ -16,33 +16,32 @@ from authzed.api.v1 import core_pb2 as authzed_dot_api_dot_v1_dot_core__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#authzed/api/v1/schema_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x19\x61uthzed/api/v1/core.proto\"\x13\n\x11ReadSchemaRequest\"r\n\x12ReadSchemaResponse\x12\x1f\n\x0bschema_text\x18\x01 \x01(\tR\nschemaText\x12;\n\x07read_at\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06readAt\"7\n\x12WriteSchemaRequest\x12!\n\x06schema\x18\x01 \x01(\tB\t\xfa\x42\x06r\x04(\x80\x80\x10R\x06schema\"X\n\x13WriteSchemaResponse\x12\x41\n\nwritten_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\twrittenAt2\xf5\x01\n\rSchemaService\x12o\n\nReadSchema\x12!.authzed.api.v1.ReadSchemaRequest\x1a\".authzed.api.v1.ReadSchemaResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/schema/read:\x01*\x12s\n\x0bWriteSchema\x12\".authzed.api.v1.WriteSchemaRequest\x1a#.authzed.api.v1.WriteSchemaResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/schema/write:\x01*BH\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#authzed/api/v1/schema_service.proto\x12\x0e\x61uthzed.api.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17validate/validate.proto\x1a\x19\x61uthzed/api/v1/core.proto\"\x13\n\x11ReadSchemaRequest\"r\n\x12ReadSchemaResponse\x12\x1f\n\x0bschema_text\x18\x01 \x01(\tR\nschemaText\x12;\n\x07read_at\x18\x02 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\x06readAt\"8\n\x12WriteSchemaRequest\x12\"\n\x06schema\x18\x01 \x01(\tB\n\xfa\x42\x07r\x05(\x80\x80\x80\x02R\x06schema\"X\n\x13WriteSchemaResponse\x12\x41\n\nwritten_at\x18\x01 \x01(\x0b\x32\x18.authzed.api.v1.ZedTokenB\x08\xfa\x42\x05\x8a\x01\x02\x10\x01R\twrittenAt2\xf5\x01\n\rSchemaService\x12o\n\nReadSchema\x12!.authzed.api.v1.ReadSchemaRequest\x1a\".authzed.api.v1.ReadSchemaResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\"\x0f/v1/schema/read:\x01*\x12s\n\x0bWriteSchema\x12\".authzed.api.v1.WriteSchemaRequest\x1a#.authzed.api.v1.WriteSchemaResponse\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/schema/write:\x01*BH\n\x12\x63om.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.schema_service_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _READSCHEMARESPONSE.fields_by_name['read_at']._options = None - _READSCHEMARESPONSE.fields_by_name['read_at']._serialized_options = b'\372B\005\212\001\002\020\001' - _WRITESCHEMAREQUEST.fields_by_name['schema']._options = None - _WRITESCHEMAREQUEST.fields_by_name['schema']._serialized_options = b'\372B\006r\004(\200\200\020' - _WRITESCHEMARESPONSE.fields_by_name['written_at']._options = None - _WRITESCHEMARESPONSE.fields_by_name['written_at']._serialized_options = b'\372B\005\212\001\002\020\001' - _SCHEMASERVICE.methods_by_name['ReadSchema']._options = None - _SCHEMASERVICE.methods_by_name['ReadSchema']._serialized_options = b'\202\323\344\223\002\024\"\017/v1/schema/read:\001*' - _SCHEMASERVICE.methods_by_name['WriteSchema']._options = None - _SCHEMASERVICE.methods_by_name['WriteSchema']._serialized_options = b'\202\323\344\223\002\025\"\020/v1/schema/write:\001*' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_READSCHEMARESPONSE'].fields_by_name['read_at']._options = None + _globals['_READSCHEMARESPONSE'].fields_by_name['read_at']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_WRITESCHEMAREQUEST'].fields_by_name['schema']._options = None + _globals['_WRITESCHEMAREQUEST'].fields_by_name['schema']._serialized_options = b'\372B\007r\005(\200\200\200\002' + _globals['_WRITESCHEMARESPONSE'].fields_by_name['written_at']._options = None + _globals['_WRITESCHEMARESPONSE'].fields_by_name['written_at']._serialized_options = b'\372B\005\212\001\002\020\001' + _globals['_SCHEMASERVICE'].methods_by_name['ReadSchema']._options = None + _globals['_SCHEMASERVICE'].methods_by_name['ReadSchema']._serialized_options = b'\202\323\344\223\002\024\"\017/v1/schema/read:\001*' + _globals['_SCHEMASERVICE'].methods_by_name['WriteSchema']._options = None + _globals['_SCHEMASERVICE'].methods_by_name['WriteSchema']._serialized_options = b'\202\323\344\223\002\025\"\020/v1/schema/write:\001*' _globals['_READSCHEMAREQUEST']._serialized_start=137 _globals['_READSCHEMAREQUEST']._serialized_end=156 _globals['_READSCHEMARESPONSE']._serialized_start=158 _globals['_READSCHEMARESPONSE']._serialized_end=272 _globals['_WRITESCHEMAREQUEST']._serialized_start=274 - _globals['_WRITESCHEMAREQUEST']._serialized_end=329 - _globals['_WRITESCHEMARESPONSE']._serialized_start=331 - _globals['_WRITESCHEMARESPONSE']._serialized_end=419 - _globals['_SCHEMASERVICE']._serialized_start=422 - _globals['_SCHEMASERVICE']._serialized_end=667 + _globals['_WRITESCHEMAREQUEST']._serialized_end=330 + _globals['_WRITESCHEMARESPONSE']._serialized_start=332 + _globals['_WRITESCHEMARESPONSE']._serialized_end=420 + _globals['_SCHEMASERVICE']._serialized_start=423 + _globals['_SCHEMASERVICE']._serialized_end=668 # @@protoc_insertion_point(module_scope) diff --git a/authzed/api/v1/schema_service_pb2.pyi b/authzed/api/v1/schema_service_pb2.pyi index 80e5144..1a34b73 100644 --- a/authzed/api/v1/schema_service_pb2.pyi +++ b/authzed/api/v1/schema_service_pb2.pyi @@ -62,7 +62,7 @@ class WriteSchemaRequest(google.protobuf.message.Message): schema: builtins.str """The Schema containing one or more Object Definitions that will be written to the Permissions System. - 256KiB + 4MiB """ def __init__( self, diff --git a/authzed/api/v1/watch_service_pb2.py b/authzed/api/v1/watch_service_pb2.py index 74be03c..a976ecb 100644 --- a/authzed/api/v1/watch_service_pb2.py +++ b/authzed/api/v1/watch_service_pb2.py @@ -22,13 +22,12 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1.watch_service_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' - _WATCHREQUEST.fields_by_name['optional_object_types']._options = None - _WATCHREQUEST.fields_by_name['optional_object_types']._serialized_options = b'\372BL\222\001I\010\000\"ErC(\200\0012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _WATCHSERVICE.methods_by_name['Watch']._options = None - _WATCHSERVICE.methods_by_name['Watch']._serialized_options = b'\202\323\344\223\002\016\"\t/v1/watch:\001*' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\022com.authzed.api.v1Z2github.com/authzed/authzed-go/proto/authzed/api/v1' + _globals['_WATCHREQUEST'].fields_by_name['optional_object_types']._options = None + _globals['_WATCHREQUEST'].fields_by_name['optional_object_types']._serialized_options = b'\372BL\222\001I\010\000\"ErC(\200\0012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_WATCHSERVICE'].methods_by_name['Watch']._options = None + _globals['_WATCHSERVICE'].methods_by_name['Watch']._serialized_options = b'\202\323\344\223\002\016\"\t/v1/watch:\001*' _globals['_WATCHREQUEST']._serialized_start=137 _globals['_WATCHREQUEST']._serialized_end=363 _globals['_WATCHRESPONSE']._serialized_start=366 diff --git a/authzed/api/v1alpha1/schema_pb2.py b/authzed/api/v1alpha1/schema_pb2.py index 4202262..bcd7351 100644 --- a/authzed/api/v1alpha1/schema_pb2.py +++ b/authzed/api/v1alpha1/schema_pb2.py @@ -20,13 +20,12 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1alpha1.schema_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\030com.authzed.api.v1alpha1Z8github.com/authzed/authzed-go/proto/authzed/api/v1alpha1' - _READSCHEMAREQUEST.fields_by_name['object_definitions_names']._options = None - _READSCHEMAREQUEST.fields_by_name['object_definitions_names']._serialized_options = b'\372BJ\222\001G\"ErC(\200\0012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _WRITESCHEMAREQUEST.fields_by_name['schema']._options = None - _WRITESCHEMAREQUEST.fields_by_name['schema']._serialized_options = b'\372B\006r\004(\200\200\020' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\030com.authzed.api.v1alpha1Z8github.com/authzed/authzed-go/proto/authzed/api/v1alpha1' + _globals['_READSCHEMAREQUEST'].fields_by_name['object_definitions_names']._options = None + _globals['_READSCHEMAREQUEST'].fields_by_name['object_definitions_names']._serialized_options = b'\372BJ\222\001G\"ErC(\200\0012>^([a-z][a-z0-9_]{1,62}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_WRITESCHEMAREQUEST'].fields_by_name['schema']._options = None + _globals['_WRITESCHEMAREQUEST'].fields_by_name['schema']._serialized_options = b'\372B\006r\004(\200\200\020' _globals['_READSCHEMAREQUEST']._serialized_start=85 _globals['_READSCHEMAREQUEST']._serialized_end=242 _globals['_READSCHEMARESPONSE']._serialized_start=245 diff --git a/authzed/api/v1alpha1/watchresources_service_pb2.py b/authzed/api/v1alpha1/watchresources_service_pb2.py index 7c7a9ad..6c0581d 100644 --- a/authzed/api/v1alpha1/watchresources_service_pb2.py +++ b/authzed/api/v1alpha1/watchresources_service_pb2.py @@ -22,15 +22,14 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'authzed.api.v1alpha1.watchresources_service_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\030com.authzed.api.v1alpha1Z8github.com/authzed/authzed-go/proto/authzed/api/v1alpha1' - _WATCHRESOURCESREQUEST.fields_by_name['resource_object_type']._options = None - _WATCHRESOURCESREQUEST.fields_by_name['resource_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _WATCHRESOURCESREQUEST.fields_by_name['permission']._options = None - _WATCHRESOURCESREQUEST.fields_by_name['permission']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' - _WATCHRESOURCESSERVICE.methods_by_name['WatchResources']._options = None - _WATCHRESOURCESSERVICE.methods_by_name['WatchResources']._serialized_options = b'\202\323\344\223\002\032\"\025/v1alpha1/lookupwatch:\001*' + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\030com.authzed.api.v1alpha1Z8github.com/authzed/authzed-go/proto/authzed/api/v1alpha1' + _globals['_WATCHRESOURCESREQUEST'].fields_by_name['resource_object_type']._options = None + _globals['_WATCHRESOURCESREQUEST'].fields_by_name['resource_object_type']._serialized_options = b'\372BErC(\200\0012>^([a-z][a-z0-9_]{1,61}[a-z0-9]/)*[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_WATCHRESOURCESREQUEST'].fields_by_name['permission']._options = None + _globals['_WATCHRESOURCESREQUEST'].fields_by_name['permission']._serialized_options = b'\372B$r\"(@2\036^[a-z][a-z0-9_]{1,62}[a-z0-9]$' + _globals['_WATCHRESOURCESSERVICE'].methods_by_name['WatchResources']._options = None + _globals['_WATCHRESOURCESSERVICE'].methods_by_name['WatchResources']._serialized_options = b'\202\323\344\223\002\032\"\025/v1alpha1/lookupwatch:\001*' _globals['_WATCHRESOURCESREQUEST']._serialized_start=158 _globals['_WATCHRESOURCESREQUEST']._serialized_end=564 _globals['_PERMISSIONUPDATE']._serialized_start=567 diff --git a/buf.gen.yaml b/buf.gen.yaml index dcca1ee..6448c5f 100755 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,4 +1,4 @@ -#!/usr/bin/env -S buf generate buf.build/authzed/api:206ed0aae546729d1bba96f506972b78eab4feeb --verbose --debug --template +#!/usr/bin/env -S buf generate buf.build/authzed/api:ae0019fd4971464faeac85b2e146bdb8 --verbose --debug --template --- version: "v1" plugins: From 98e992171089c3b65e2c708a215947ac111c4562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 11:08:50 +0100 Subject: [PATCH 3/6] add bulk import / export examples and tests --- .../v1/bulk_import_export_relationships.py | 74 +++++++++++++++++++ tests/v1_test.py | 48 ++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 examples/v1/bulk_import_export_relationships.py diff --git a/examples/v1/bulk_import_export_relationships.py b/examples/v1/bulk_import_export_relationships.py new file mode 100644 index 0000000..f133131 --- /dev/null +++ b/examples/v1/bulk_import_export_relationships.py @@ -0,0 +1,74 @@ +from authzed.api.v1 import ( + BulkExportRelationshipsRequest, + BulkImportRelationshipsRequest, + Client, + Consistency, + ObjectReference, + Relationship, + SubjectReference, + WriteSchemaRequest, +) +from grpcutil import insecure_bearer_token_credentials + +emilia = SubjectReference( + object=ObjectReference( + object_type="user", + object_id="emilia", + ) +) +beatrice = SubjectReference( + object=ObjectReference( + object_type="user", + object_id="beatrice", + ) +) + +post_one = ObjectReference(object_type="post", object_id="1") + +client = Client( + "localhost:50051", + insecure_bearer_token_credentials("t_your_token_here_1234567deadbeef"), +) + +schema = """ + definition post { + relation writer: user + relation reader: user + + permission write = writer + permission view = reader + writer + } + definition user {} +""" +client.WriteSchema(WriteSchemaRequest(schema=schema)) + + +reqs = [ + BulkImportRelationshipsRequest( + relationships=[ + Relationship( + resource=post_one, + relation="reader", + subject=emilia, + ), + Relationship( + resource=post_one, + relation="writer", + subject=beatrice, + ), + ] + ) +] + +import_reps = client.BulkImportRelationships(((req for req in reqs))) +assert import_reps.num_loaded == 2 + +export_resp = client.BulkExportRelationships( + BulkExportRelationshipsRequest(consistency=Consistency(fully_consistent=True)) +) + +rels = [] +for response in export_resp: + for rel in response.relationships: + rels.append(rel) +assert len(rels) == 2 diff --git a/tests/v1_test.py b/tests/v1_test.py index 71273b4..5b4a849 100644 --- a/tests/v1_test.py +++ b/tests/v1_test.py @@ -6,6 +6,8 @@ from authzed.api.v1 import ( BulkCheckPermissionRequest, BulkCheckPermissionRequestItem, + BulkExportRelationshipsRequest, + BulkImportRelationshipsRequest, CheckPermissionRequest, CheckPermissionResponse, Client, @@ -219,6 +221,52 @@ def test_bulk_check(client): ) +def test_bulk_export_import(client): + write_test_schema(client) + write_test_tuples(client) + + # validate bulk export returns all relationships written + resp = client.BulkExportRelationships( + BulkExportRelationshipsRequest(consistency=Consistency(fully_consistent=True)) + ) + + rels = rels_from_bulk_export_response(resp) + assert len(rels) == 4 + + # create a new empty client + empty_client = Client("localhost:50051", insecure_bearer_token_credentials(str(uuid.uuid4()))) + write_test_schema(empty_client) + + # validate indeed empty client is empty + resp = empty_client.BulkExportRelationships( + BulkExportRelationshipsRequest(consistency=Consistency(fully_consistent=True)) + ) + + no_rels = rels_from_bulk_export_response(resp) + assert len(no_rels) == 0 + + # do bulk import + reqs = [BulkImportRelationshipsRequest(relationships=rels)] + import_rels = empty_client.BulkImportRelationships(((req for req in reqs))) + assert import_rels.num_loaded == 4 + + # validate all relationships were imported + resp = empty_client.BulkExportRelationships( + BulkExportRelationshipsRequest(consistency=Consistency(fully_consistent=True)) + ) + + rels = rels_from_bulk_export_response(resp) + assert len(rels) == 4 + + +def rels_from_bulk_export_response(resp): + rels = [] + for response in resp: + for rel in response.relationships: + rels.append(rel) + return rels + + def write_test_tuples(client): emilia = SubjectReference( object=ObjectReference( From f3955514d3bcdd852c87ae08725361800dc3bdab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 10:16:41 +0100 Subject: [PATCH 4/6] update tested Python versions - 3.7 is EOL - 3.11 and 3.12 got released there is an error when importing dependencies in 3.12, so I've excluded it for now --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0fe2fc6..1239515 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,10 +13,10 @@ jobs: strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" + - "3.11" steps: - uses: "actions/checkout@v3" - uses: "actions/setup-python@v4" From 3e531980cd19b4ceb312c36efe94b8b80250ec85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 11:26:40 +0100 Subject: [PATCH 5/6] expose WatchService --- authzed/api/v1/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/authzed/api/v1/__init__.py b/authzed/api/v1/__init__.py index 17591a8..cf440d9 100644 --- a/authzed/api/v1/__init__.py +++ b/authzed/api/v1/__init__.py @@ -55,9 +55,11 @@ WriteSchemaResponse, ) from authzed.api.v1.schema_service_pb2_grpc import SchemaServiceStub +from authzed.api.v1.watch_service_pb2 import WatchRequest, WatchResponse +from authzed.api.v1.watch_service_pb2_grpc import WatchServiceStub -class Client(SchemaServiceStub, PermissionsServiceStub, ExperimentalServiceStub): +class Client(SchemaServiceStub, PermissionsServiceStub, ExperimentalServiceStub, WatchServiceStub): """ v1 Authzed gRPC API client. """ @@ -73,6 +75,7 @@ def __init__(self, target, credentials, options=None, compression=None): SchemaServiceStub.__init__(self, channel) PermissionsServiceStub.__init__(self, channel) ExperimentalServiceStub.__init__(self, channel) + WatchServiceStub.__init__(self, channel) __all__ = [ @@ -113,6 +116,9 @@ def __init__(self, target, credentials, options=None, compression=None): "ReadSchemaResponse", "WriteSchemaRequest", "WriteSchemaResponse", + # Watch Service + "WatchRequest", + "WatchResponse", # Experimental Service "BulkCheckPermissionRequest", "BulkCheckPermissionResponse", From 750d832182ccc63f39d14e79bd841de0bb3b68cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rold=C3=A1n=20Betancort?= Date: Mon, 16 Oct 2023 12:51:10 +0100 Subject: [PATCH 6/6] bump version due to new features --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index acf6bb9..17e173e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ description = "Client library for SpiceDB." # NOTE: These two lines must be kept together for the API update action to function name = "authzed" -version = "0.12.0" +version = "0.13.0" packages = [ {include = "authzed"}, {include = "validate"},