diff --git a/proto/apidocs.swagger.json b/proto/apidocs.swagger.json index a4a4d9f..8981eb3 100644 --- a/proto/apidocs.swagger.json +++ b/proto/apidocs.swagger.json @@ -48,6 +48,79 @@ "application/json" ], "paths": { + "/v1/experimental/permissions/bulkcheckpermission": { + "post": { + "operationId": "ExperimentalService_BulkCheckPermission", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BulkCheckPermissionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1BulkCheckPermissionRequest" + } + } + ], + "tags": [ + "ExperimentalService" + ] + } + }, + "/v1/experimental/permissions/streamingbulkcheckpermission": { + "post": { + "operationId": "ExperimentalService_StreamingBulkCheckPermission", + "responses": { + "200": { + "description": "A successful response.(streaming responses)", + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/v1StreamingBulkCheckPermissionResponse" + }, + "error": { + "$ref": "#/definitions/rpcStatus" + } + }, + "title": "Stream result of v1StreamingBulkCheckPermissionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StreamingBulkCheckPermissionRequest" + } + } + ], + "tags": [ + "ExperimentalService" + ] + } + }, "/v1/experimental/relationships/bulkexport": { "post": { "summary": "BulkExportRelationships is the fastest path available to exporting\nrelationships from the server. It is resumable, and will return results\nin an order determined by the server.", @@ -932,6 +1005,75 @@ ], "default": "OPERATION_UNSPECIFIED" }, + "v1BulkCheckPermissionPair": { + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/v1BulkCheckPermissionRequestItem" + }, + "response": { + "$ref": "#/definitions/v1BulkCheckPermissionResponseItem" + } + } + }, + "v1BulkCheckPermissionRequest": { + "type": "object", + "properties": { + "consistency": { + "$ref": "#/definitions/v1Consistency" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BulkCheckPermissionRequestItem" + } + } + } + }, + "v1BulkCheckPermissionRequestItem": { + "type": "object", + "properties": { + "resource": { + "$ref": "#/definitions/v1ObjectReference" + }, + "permission": { + "type": "string" + }, + "subject": { + "$ref": "#/definitions/v1SubjectReference" + }, + "context": { + "type": "object" + } + } + }, + "v1BulkCheckPermissionResponse": { + "type": "object", + "properties": { + "checkedAt": { + "$ref": "#/definitions/v1ZedToken" + }, + "pairs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BulkCheckPermissionPair" + } + } + } + }, + "v1BulkCheckPermissionResponseItem": { + "type": "object", + "properties": { + "permissionship": { + "$ref": "#/definitions/v1CheckPermissionResponsePermissionship" + }, + "partialCaveatInfo": { + "$ref": "#/definitions/v1PartialCaveatInfo" + } + } + }, "v1BulkExportRelationshipsRequest": { "type": "object", "properties": { @@ -1506,6 +1648,36 @@ }, "description": "ResolvedSubject is a single subject resolved within LookupSubjects." }, + "v1StreamingBulkCheckPermissionRequest": { + "type": "object", + "properties": { + "consistency": { + "$ref": "#/definitions/v1Consistency" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BulkCheckPermissionRequestItem" + } + } + } + }, + "v1StreamingBulkCheckPermissionResponse": { + "type": "object", + "properties": { + "checkedAt": { + "$ref": "#/definitions/v1ZedToken" + }, + "pairs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1BulkCheckPermissionPair" + } + } + } + }, "v1SubjectFilter": { "type": "object", "properties": { diff --git a/proto/authzed/api/v0/zz_generated.version.go b/proto/authzed/api/v0/zz_generated.version.go index 023a3f7..c4a0e6d 100644 --- a/proto/authzed/api/v0/zz_generated.version.go +++ b/proto/authzed/api/v0/zz_generated.version.go @@ -2,5 +2,5 @@ package v0 const ( BufRepository = "buf.build/authzed/api" - BufTag = "dc592e107033a7a4336935cf94fb90426719508d" + BufTag = "da9870cabdeeb5b2ac48f1bd030409037bff6a76" ) diff --git a/proto/authzed/api/v1/experimental_service.pb.go b/proto/authzed/api/v1/experimental_service.pb.go index a2f998a..5db1c43 100644 --- a/proto/authzed/api/v1/experimental_service.pb.go +++ b/proto/authzed/api/v1/experimental_service.pb.go @@ -11,6 +11,7 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" reflect "reflect" sync "sync" ) @@ -22,6 +23,407 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type StreamingBulkCheckPermissionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consistency *Consistency `protobuf:"bytes,1,opt,name=consistency,proto3" json:"consistency,omitempty"` + Items []*BulkCheckPermissionRequestItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *StreamingBulkCheckPermissionRequest) Reset() { + *x = StreamingBulkCheckPermissionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingBulkCheckPermissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingBulkCheckPermissionRequest) ProtoMessage() {} + +func (x *StreamingBulkCheckPermissionRequest) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingBulkCheckPermissionRequest.ProtoReflect.Descriptor instead. +func (*StreamingBulkCheckPermissionRequest) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{0} +} + +func (x *StreamingBulkCheckPermissionRequest) GetConsistency() *Consistency { + if x != nil { + return x.Consistency + } + return nil +} + +func (x *StreamingBulkCheckPermissionRequest) GetItems() []*BulkCheckPermissionRequestItem { + if x != nil { + return x.Items + } + return nil +} + +type BulkCheckPermissionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consistency *Consistency `protobuf:"bytes,1,opt,name=consistency,proto3" json:"consistency,omitempty"` + Items []*BulkCheckPermissionRequestItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *BulkCheckPermissionRequest) Reset() { + *x = BulkCheckPermissionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkCheckPermissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkCheckPermissionRequest) ProtoMessage() {} + +func (x *BulkCheckPermissionRequest) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BulkCheckPermissionRequest.ProtoReflect.Descriptor instead. +func (*BulkCheckPermissionRequest) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{1} +} + +func (x *BulkCheckPermissionRequest) GetConsistency() *Consistency { + if x != nil { + return x.Consistency + } + return nil +} + +func (x *BulkCheckPermissionRequest) GetItems() []*BulkCheckPermissionRequestItem { + if x != nil { + return x.Items + } + return nil +} + +type BulkCheckPermissionRequestItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resource *ObjectReference `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"` + Subject *SubjectReference `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"` + Context *structpb.Struct `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"` +} + +func (x *BulkCheckPermissionRequestItem) Reset() { + *x = BulkCheckPermissionRequestItem{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkCheckPermissionRequestItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkCheckPermissionRequestItem) ProtoMessage() {} + +func (x *BulkCheckPermissionRequestItem) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BulkCheckPermissionRequestItem.ProtoReflect.Descriptor instead. +func (*BulkCheckPermissionRequestItem) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{2} +} + +func (x *BulkCheckPermissionRequestItem) GetResource() *ObjectReference { + if x != nil { + return x.Resource + } + return nil +} + +func (x *BulkCheckPermissionRequestItem) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *BulkCheckPermissionRequestItem) GetSubject() *SubjectReference { + if x != nil { + return x.Subject + } + return nil +} + +func (x *BulkCheckPermissionRequestItem) GetContext() *structpb.Struct { + if x != nil { + return x.Context + } + return nil +} + +type BulkCheckPermissionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CheckedAt *ZedToken `protobuf:"bytes,1,opt,name=checked_at,json=checkedAt,proto3" json:"checked_at,omitempty"` + Pairs []*BulkCheckPermissionPair `protobuf:"bytes,2,rep,name=pairs,proto3" json:"pairs,omitempty"` +} + +func (x *BulkCheckPermissionResponse) Reset() { + *x = BulkCheckPermissionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkCheckPermissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkCheckPermissionResponse) ProtoMessage() {} + +func (x *BulkCheckPermissionResponse) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BulkCheckPermissionResponse.ProtoReflect.Descriptor instead. +func (*BulkCheckPermissionResponse) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{3} +} + +func (x *BulkCheckPermissionResponse) GetCheckedAt() *ZedToken { + if x != nil { + return x.CheckedAt + } + return nil +} + +func (x *BulkCheckPermissionResponse) GetPairs() []*BulkCheckPermissionPair { + if x != nil { + return x.Pairs + } + return nil +} + +type StreamingBulkCheckPermissionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CheckedAt *ZedToken `protobuf:"bytes,1,opt,name=checked_at,json=checkedAt,proto3" json:"checked_at,omitempty"` + Pairs []*BulkCheckPermissionPair `protobuf:"bytes,2,rep,name=pairs,proto3" json:"pairs,omitempty"` +} + +func (x *StreamingBulkCheckPermissionResponse) Reset() { + *x = StreamingBulkCheckPermissionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamingBulkCheckPermissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamingBulkCheckPermissionResponse) ProtoMessage() {} + +func (x *StreamingBulkCheckPermissionResponse) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StreamingBulkCheckPermissionResponse.ProtoReflect.Descriptor instead. +func (*StreamingBulkCheckPermissionResponse) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{4} +} + +func (x *StreamingBulkCheckPermissionResponse) GetCheckedAt() *ZedToken { + if x != nil { + return x.CheckedAt + } + return nil +} + +func (x *StreamingBulkCheckPermissionResponse) GetPairs() []*BulkCheckPermissionPair { + if x != nil { + return x.Pairs + } + return nil +} + +type BulkCheckPermissionPair struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Request *BulkCheckPermissionRequestItem `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + Response *BulkCheckPermissionResponseItem `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +} + +func (x *BulkCheckPermissionPair) Reset() { + *x = BulkCheckPermissionPair{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkCheckPermissionPair) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkCheckPermissionPair) ProtoMessage() {} + +func (x *BulkCheckPermissionPair) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BulkCheckPermissionPair.ProtoReflect.Descriptor instead. +func (*BulkCheckPermissionPair) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{5} +} + +func (x *BulkCheckPermissionPair) GetRequest() *BulkCheckPermissionRequestItem { + if x != nil { + return x.Request + } + return nil +} + +func (x *BulkCheckPermissionPair) GetResponse() *BulkCheckPermissionResponseItem { + if x != nil { + return x.Response + } + return nil +} + +type BulkCheckPermissionResponseItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Permissionship CheckPermissionResponse_Permissionship `protobuf:"varint,2,opt,name=permissionship,proto3,enum=authzed.api.v1.CheckPermissionResponse_Permissionship" json:"permissionship,omitempty"` + PartialCaveatInfo *PartialCaveatInfo `protobuf:"bytes,3,opt,name=partial_caveat_info,json=partialCaveatInfo,proto3" json:"partial_caveat_info,omitempty"` +} + +func (x *BulkCheckPermissionResponseItem) Reset() { + *x = BulkCheckPermissionResponseItem{} + if protoimpl.UnsafeEnabled { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BulkCheckPermissionResponseItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BulkCheckPermissionResponseItem) ProtoMessage() {} + +func (x *BulkCheckPermissionResponseItem) ProtoReflect() protoreflect.Message { + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BulkCheckPermissionResponseItem.ProtoReflect.Descriptor instead. +func (*BulkCheckPermissionResponseItem) Descriptor() ([]byte, []int) { + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{6} +} + +func (x *BulkCheckPermissionResponseItem) GetPermissionship() CheckPermissionResponse_Permissionship { + if x != nil { + return x.Permissionship + } + return CheckPermissionResponse_PERMISSIONSHIP_UNSPECIFIED +} + +func (x *BulkCheckPermissionResponseItem) GetPartialCaveatInfo() *PartialCaveatInfo { + if x != nil { + return x.PartialCaveatInfo + } + return nil +} + // BulkImportRelationshipsRequest represents one batch of the streaming // BulkImportRelationships API. The maximum size is only limited by the backing // datastore, and optimal size should be determined by the calling client @@ -37,7 +439,7 @@ type BulkImportRelationshipsRequest struct { func (x *BulkImportRelationshipsRequest) Reset() { *x = BulkImportRelationshipsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[0] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +452,7 @@ func (x *BulkImportRelationshipsRequest) String() string { func (*BulkImportRelationshipsRequest) ProtoMessage() {} func (x *BulkImportRelationshipsRequest) ProtoReflect() protoreflect.Message { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[0] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -63,7 +465,7 @@ func (x *BulkImportRelationshipsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BulkImportRelationshipsRequest.ProtoReflect.Descriptor instead. func (*BulkImportRelationshipsRequest) Descriptor() ([]byte, []int) { - return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{0} + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{7} } func (x *BulkImportRelationshipsRequest) GetRelationships() []*Relationship { @@ -86,7 +488,7 @@ type BulkImportRelationshipsResponse struct { func (x *BulkImportRelationshipsResponse) Reset() { *x = BulkImportRelationshipsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[1] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -99,7 +501,7 @@ func (x *BulkImportRelationshipsResponse) String() string { func (*BulkImportRelationshipsResponse) ProtoMessage() {} func (x *BulkImportRelationshipsResponse) ProtoReflect() protoreflect.Message { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[1] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -112,7 +514,7 @@ func (x *BulkImportRelationshipsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BulkImportRelationshipsResponse.ProtoReflect.Descriptor instead. func (*BulkImportRelationshipsResponse) Descriptor() ([]byte, []int) { - return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{1} + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{8} } func (x *BulkImportRelationshipsResponse) GetNumLoaded() uint64 { @@ -144,7 +546,7 @@ type BulkExportRelationshipsRequest struct { func (x *BulkExportRelationshipsRequest) Reset() { *x = BulkExportRelationshipsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[2] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -157,7 +559,7 @@ func (x *BulkExportRelationshipsRequest) String() string { func (*BulkExportRelationshipsRequest) ProtoMessage() {} func (x *BulkExportRelationshipsRequest) ProtoReflect() protoreflect.Message { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[2] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -170,7 +572,7 @@ func (x *BulkExportRelationshipsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BulkExportRelationshipsRequest.ProtoReflect.Descriptor instead. func (*BulkExportRelationshipsRequest) Descriptor() ([]byte, []int) { - return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{2} + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{9} } func (x *BulkExportRelationshipsRequest) GetConsistency() *Consistency { @@ -210,7 +612,7 @@ type BulkExportRelationshipsResponse struct { func (x *BulkExportRelationshipsResponse) Reset() { *x = BulkExportRelationshipsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[3] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -223,7 +625,7 @@ func (x *BulkExportRelationshipsResponse) String() string { func (*BulkExportRelationshipsResponse) ProtoMessage() {} func (x *BulkExportRelationshipsResponse) ProtoReflect() protoreflect.Message { - mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[3] + mi := &file_authzed_api_v1_experimental_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -236,7 +638,7 @@ func (x *BulkExportRelationshipsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BulkExportRelationshipsResponse.ProtoReflect.Descriptor instead. func (*BulkExportRelationshipsResponse) Descriptor() ([]byte, []int) { - return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{3} + return file_authzed_api_v1_experimental_service_proto_rawDescGZIP(), []int{10} } func (x *BulkExportRelationshipsResponse) GetAfterResultCursor() *Cursor { @@ -263,76 +665,193 @@ var file_authzed_api_v1_experimental_service_proto_rawDesc = []byte{ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x19, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x61, - 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x73, 0x0a, 0x1e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x42, 0x0d, 0xfa, - 0x42, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0d, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x22, 0x40, 0x0a, 0x1f, 0x42, - 0x75, 0x6c, 0x6b, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x22, 0xd3, 0x01, - 0x0a, 0x1e, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3d, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, - 0x63, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x12, - 0x31, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x2a, 0x05, 0x18, 0x90, - 0x4e, 0x28, 0x00, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x3f, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x63, - 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, - 0x73, 0x6f, 0x72, 0x52, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x75, 0x72, - 0x73, 0x6f, 0x72, 0x22, 0xad, 0x01, 0x0a, 0x1f, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, - 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x13, 0x61, 0x66, 0x74, 0x65, 0x72, - 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x11, 0x61, 0x66, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, - 0x42, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x32, 0xff, 0x02, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, - 0x6e, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb2, 0x01, 0x0a, 0x17, + 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x23, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x53, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x92, + 0x01, 0x07, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x22, 0xb0, 0x01, 0x0a, 0x1a, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3d, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x53, + 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x0d, 0xfa, + 0x42, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x22, 0xb6, 0x02, 0x0a, 0x1e, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x45, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4a, 0x0a, + 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x2a, 0xfa, 0x42, 0x27, 0x72, 0x25, 0x28, 0x40, 0x32, 0x21, 0x5e, 0x28, 0x5b, 0x61, + 0x2d, 0x7a, 0x5d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5f, 0x5d, 0x7b, 0x31, 0x2c, 0x36, + 0x32, 0x7d, 0x5b, 0x61, 0x2d, 0x7a, 0x30, 0x2d, 0x39, 0x5d, 0x29, 0x3f, 0x24, 0x52, 0x0a, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x07, 0x73, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x3b, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0xae, 0x01, 0x0a, + 0x1b, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0a, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x5a, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x00, 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x4c, 0x0a, 0x05, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x69, 0x72, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x92, 0x01, 0x07, 0x22, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x70, 0x61, 0x69, 0x72, 0x73, 0x22, 0xb7, 0x01, + 0x0a, 0x24, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x6c, 0x6b, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x65, 0x64, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x00, 0x52, 0x09, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, 0x4c, 0x0a, 0x05, 0x70, 0x61, 0x69, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x69, + 0x72, 0x42, 0x0d, 0xfa, 0x42, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x05, 0x70, 0x61, 0x69, 0x72, 0x73, 0x22, 0xb0, 0x01, 0x0a, 0x17, 0x42, 0x75, 0x6c, 0x6b, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x69, 0x72, 0x12, 0x48, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xea, 0x01, 0x0a, 0x1f, 0x42, + 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x6a, + 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x82, 0x01, 0x04, 0x10, 0x01, 0x20, 0x00, 0x52, 0x0e, 0x70, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x12, 0x5b, 0x0a, 0x13, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x76, 0x65, 0x61, 0x74, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, + 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, + 0x43, 0x61, 0x76, 0x65, 0x61, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x00, 0x52, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x43, 0x61, 0x76, + 0x65, 0x61, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x73, 0x0a, 0x1e, 0x42, 0x75, 0x6c, 0x6b, 0x49, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, + 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0d, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x42, 0x0d, + 0xfa, 0x42, 0x0a, 0x92, 0x01, 0x07, 0x22, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0d, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x22, 0x40, 0x0a, 0x1f, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x2e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, - 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, - 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, 0x70, + 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x22, 0xd3, + 0x01, 0x0a, 0x1e, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x63, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x12, 0x31, 0x0a, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x2a, 0x05, 0x18, + 0x90, 0x4e, 0x28, 0x00, 0x52, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x3f, 0x0a, 0x0f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x52, 0x0e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x22, 0xad, 0x01, 0x0a, 0x1f, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, - 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, - 0x69, 0x70, 0x73, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x28, 0x01, - 0x12, 0xb2, 0x01, 0x0a, 0x17, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x2e, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, - 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, - 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x65, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x30, 0x01, 0x42, 0x48, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x75, 0x74, - 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x5a, 0x32, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x13, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x52, 0x11, 0x61, + 0x66, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, + 0x12, 0x42, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, + 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x73, 0x32, 0x81, 0x06, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, + 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb2, 0x01, 0x0a, + 0x17, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x2e, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, + 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x68, 0x69, 0x70, 0x73, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x28, + 0x01, 0x12, 0xb2, 0x01, 0x0a, 0x17, 0x42, 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x12, 0x2e, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x75, 0x6c, 0x6b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x01, 0x2a, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x65, + 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x73, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x65, 0x78, + 0x70, 0x6f, 0x72, 0x74, 0x30, 0x01, 0x12, 0xd1, 0x01, 0x0a, 0x1c, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, + 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x61, + 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, + 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x62, 0x75, 0x6c, 0x6b, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x30, 0x01, 0x12, 0xab, 0x01, 0x0a, 0x13, 0x42, + 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x75, 0x6c, 0x6b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x35, 0x3a, 0x01, 0x2a, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x70, 0x65, + 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x62, 0x75, 0x6c, 0x6b, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x65, + 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x48, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x5a, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, + 0x65, 0x64, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x65, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -347,31 +866,63 @@ func file_authzed_api_v1_experimental_service_proto_rawDescGZIP() []byte { return file_authzed_api_v1_experimental_service_proto_rawDescData } -var file_authzed_api_v1_experimental_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_authzed_api_v1_experimental_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_authzed_api_v1_experimental_service_proto_goTypes = []interface{}{ - (*BulkImportRelationshipsRequest)(nil), // 0: authzed.api.v1.BulkImportRelationshipsRequest - (*BulkImportRelationshipsResponse)(nil), // 1: authzed.api.v1.BulkImportRelationshipsResponse - (*BulkExportRelationshipsRequest)(nil), // 2: authzed.api.v1.BulkExportRelationshipsRequest - (*BulkExportRelationshipsResponse)(nil), // 3: authzed.api.v1.BulkExportRelationshipsResponse - (*Relationship)(nil), // 4: authzed.api.v1.Relationship - (*Consistency)(nil), // 5: authzed.api.v1.Consistency - (*Cursor)(nil), // 6: authzed.api.v1.Cursor + (*StreamingBulkCheckPermissionRequest)(nil), // 0: authzed.api.v1.StreamingBulkCheckPermissionRequest + (*BulkCheckPermissionRequest)(nil), // 1: authzed.api.v1.BulkCheckPermissionRequest + (*BulkCheckPermissionRequestItem)(nil), // 2: authzed.api.v1.BulkCheckPermissionRequestItem + (*BulkCheckPermissionResponse)(nil), // 3: authzed.api.v1.BulkCheckPermissionResponse + (*StreamingBulkCheckPermissionResponse)(nil), // 4: authzed.api.v1.StreamingBulkCheckPermissionResponse + (*BulkCheckPermissionPair)(nil), // 5: authzed.api.v1.BulkCheckPermissionPair + (*BulkCheckPermissionResponseItem)(nil), // 6: authzed.api.v1.BulkCheckPermissionResponseItem + (*BulkImportRelationshipsRequest)(nil), // 7: authzed.api.v1.BulkImportRelationshipsRequest + (*BulkImportRelationshipsResponse)(nil), // 8: authzed.api.v1.BulkImportRelationshipsResponse + (*BulkExportRelationshipsRequest)(nil), // 9: authzed.api.v1.BulkExportRelationshipsRequest + (*BulkExportRelationshipsResponse)(nil), // 10: authzed.api.v1.BulkExportRelationshipsResponse + (*Consistency)(nil), // 11: authzed.api.v1.Consistency + (*ObjectReference)(nil), // 12: authzed.api.v1.ObjectReference + (*SubjectReference)(nil), // 13: authzed.api.v1.SubjectReference + (*structpb.Struct)(nil), // 14: google.protobuf.Struct + (*ZedToken)(nil), // 15: authzed.api.v1.ZedToken + (CheckPermissionResponse_Permissionship)(0), // 16: authzed.api.v1.CheckPermissionResponse.Permissionship + (*PartialCaveatInfo)(nil), // 17: authzed.api.v1.PartialCaveatInfo + (*Relationship)(nil), // 18: authzed.api.v1.Relationship + (*Cursor)(nil), // 19: authzed.api.v1.Cursor } var file_authzed_api_v1_experimental_service_proto_depIdxs = []int32{ - 4, // 0: authzed.api.v1.BulkImportRelationshipsRequest.relationships:type_name -> authzed.api.v1.Relationship - 5, // 1: authzed.api.v1.BulkExportRelationshipsRequest.consistency:type_name -> authzed.api.v1.Consistency - 6, // 2: authzed.api.v1.BulkExportRelationshipsRequest.optional_cursor:type_name -> authzed.api.v1.Cursor - 6, // 3: authzed.api.v1.BulkExportRelationshipsResponse.after_result_cursor:type_name -> authzed.api.v1.Cursor - 4, // 4: authzed.api.v1.BulkExportRelationshipsResponse.relationships:type_name -> authzed.api.v1.Relationship - 0, // 5: authzed.api.v1.ExperimentalService.BulkImportRelationships:input_type -> authzed.api.v1.BulkImportRelationshipsRequest - 2, // 6: authzed.api.v1.ExperimentalService.BulkExportRelationships:input_type -> authzed.api.v1.BulkExportRelationshipsRequest - 1, // 7: authzed.api.v1.ExperimentalService.BulkImportRelationships:output_type -> authzed.api.v1.BulkImportRelationshipsResponse - 3, // 8: authzed.api.v1.ExperimentalService.BulkExportRelationships:output_type -> authzed.api.v1.BulkExportRelationshipsResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 11, // 0: authzed.api.v1.StreamingBulkCheckPermissionRequest.consistency:type_name -> authzed.api.v1.Consistency + 2, // 1: authzed.api.v1.StreamingBulkCheckPermissionRequest.items:type_name -> authzed.api.v1.BulkCheckPermissionRequestItem + 11, // 2: authzed.api.v1.BulkCheckPermissionRequest.consistency:type_name -> authzed.api.v1.Consistency + 2, // 3: authzed.api.v1.BulkCheckPermissionRequest.items:type_name -> authzed.api.v1.BulkCheckPermissionRequestItem + 12, // 4: authzed.api.v1.BulkCheckPermissionRequestItem.resource:type_name -> authzed.api.v1.ObjectReference + 13, // 5: authzed.api.v1.BulkCheckPermissionRequestItem.subject:type_name -> authzed.api.v1.SubjectReference + 14, // 6: authzed.api.v1.BulkCheckPermissionRequestItem.context:type_name -> google.protobuf.Struct + 15, // 7: authzed.api.v1.BulkCheckPermissionResponse.checked_at:type_name -> authzed.api.v1.ZedToken + 5, // 8: authzed.api.v1.BulkCheckPermissionResponse.pairs:type_name -> authzed.api.v1.BulkCheckPermissionPair + 15, // 9: authzed.api.v1.StreamingBulkCheckPermissionResponse.checked_at:type_name -> authzed.api.v1.ZedToken + 5, // 10: authzed.api.v1.StreamingBulkCheckPermissionResponse.pairs:type_name -> authzed.api.v1.BulkCheckPermissionPair + 2, // 11: authzed.api.v1.BulkCheckPermissionPair.request:type_name -> authzed.api.v1.BulkCheckPermissionRequestItem + 6, // 12: authzed.api.v1.BulkCheckPermissionPair.response:type_name -> authzed.api.v1.BulkCheckPermissionResponseItem + 16, // 13: authzed.api.v1.BulkCheckPermissionResponseItem.permissionship:type_name -> authzed.api.v1.CheckPermissionResponse.Permissionship + 17, // 14: authzed.api.v1.BulkCheckPermissionResponseItem.partial_caveat_info:type_name -> authzed.api.v1.PartialCaveatInfo + 18, // 15: authzed.api.v1.BulkImportRelationshipsRequest.relationships:type_name -> authzed.api.v1.Relationship + 11, // 16: authzed.api.v1.BulkExportRelationshipsRequest.consistency:type_name -> authzed.api.v1.Consistency + 19, // 17: authzed.api.v1.BulkExportRelationshipsRequest.optional_cursor:type_name -> authzed.api.v1.Cursor + 19, // 18: authzed.api.v1.BulkExportRelationshipsResponse.after_result_cursor:type_name -> authzed.api.v1.Cursor + 18, // 19: authzed.api.v1.BulkExportRelationshipsResponse.relationships:type_name -> authzed.api.v1.Relationship + 7, // 20: authzed.api.v1.ExperimentalService.BulkImportRelationships:input_type -> authzed.api.v1.BulkImportRelationshipsRequest + 9, // 21: authzed.api.v1.ExperimentalService.BulkExportRelationships:input_type -> authzed.api.v1.BulkExportRelationshipsRequest + 0, // 22: authzed.api.v1.ExperimentalService.StreamingBulkCheckPermission:input_type -> authzed.api.v1.StreamingBulkCheckPermissionRequest + 1, // 23: authzed.api.v1.ExperimentalService.BulkCheckPermission:input_type -> authzed.api.v1.BulkCheckPermissionRequest + 8, // 24: authzed.api.v1.ExperimentalService.BulkImportRelationships:output_type -> authzed.api.v1.BulkImportRelationshipsResponse + 10, // 25: authzed.api.v1.ExperimentalService.BulkExportRelationships:output_type -> authzed.api.v1.BulkExportRelationshipsResponse + 4, // 26: authzed.api.v1.ExperimentalService.StreamingBulkCheckPermission:output_type -> authzed.api.v1.StreamingBulkCheckPermissionResponse + 3, // 27: authzed.api.v1.ExperimentalService.BulkCheckPermission:output_type -> authzed.api.v1.BulkCheckPermissionResponse + 24, // [24:28] is the sub-list for method output_type + 20, // [20:24] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_authzed_api_v1_experimental_service_proto_init() } @@ -383,7 +934,7 @@ func file_authzed_api_v1_experimental_service_proto_init() { file_authzed_api_v1_permission_service_proto_init() if !protoimpl.UnsafeEnabled { file_authzed_api_v1_experimental_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BulkImportRelationshipsRequest); i { + switch v := v.(*StreamingBulkCheckPermissionRequest); i { case 0: return &v.state case 1: @@ -395,7 +946,7 @@ func file_authzed_api_v1_experimental_service_proto_init() { } } file_authzed_api_v1_experimental_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BulkImportRelationshipsResponse); i { + switch v := v.(*BulkCheckPermissionRequest); i { case 0: return &v.state case 1: @@ -407,7 +958,7 @@ func file_authzed_api_v1_experimental_service_proto_init() { } } file_authzed_api_v1_experimental_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BulkExportRelationshipsRequest); i { + switch v := v.(*BulkCheckPermissionRequestItem); i { case 0: return &v.state case 1: @@ -419,6 +970,90 @@ func file_authzed_api_v1_experimental_service_proto_init() { } } file_authzed_api_v1_experimental_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkCheckPermissionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamingBulkCheckPermissionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkCheckPermissionPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkCheckPermissionResponseItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkImportRelationshipsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkImportRelationshipsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BulkExportRelationshipsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_authzed_api_v1_experimental_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BulkExportRelationshipsResponse); i { case 0: return &v.state @@ -437,7 +1072,7 @@ func file_authzed_api_v1_experimental_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_authzed_api_v1_experimental_service_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/authzed/api/v1/experimental_service.pb.gw.go b/proto/authzed/api/v1/experimental_service.pb.gw.go index fb9bcb4..2cc0608 100644 --- a/proto/authzed/api/v1/experimental_service.pb.gw.go +++ b/proto/authzed/api/v1/experimental_service.pb.gw.go @@ -100,6 +100,65 @@ func request_ExperimentalService_BulkExportRelationships_0(ctx context.Context, } +func request_ExperimentalService_StreamingBulkCheckPermission_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentalServiceClient, req *http.Request, pathParams map[string]string) (ExperimentalService_StreamingBulkCheckPermissionClient, runtime.ServerMetadata, error) { + var protoReq StreamingBulkCheckPermissionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.StreamingBulkCheckPermission(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + +func request_ExperimentalService_BulkCheckPermission_0(ctx context.Context, marshaler runtime.Marshaler, client ExperimentalServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BulkCheckPermissionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BulkCheckPermission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ExperimentalService_BulkCheckPermission_0(ctx context.Context, marshaler runtime.Marshaler, server ExperimentalServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq BulkCheckPermissionRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BulkCheckPermission(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterExperimentalServiceHandlerServer registers the http handlers for service ExperimentalService to "mux". // UnaryRPC :call ExperimentalServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -120,6 +179,38 @@ func RegisterExperimentalServiceHandlerServer(ctx context.Context, mux *runtime. return }) + mux.Handle("POST", pattern_ExperimentalService_StreamingBulkCheckPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("POST", pattern_ExperimentalService_BulkCheckPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/authzed.api.v1.ExperimentalService/BulkCheckPermission", runtime.WithHTTPPathPattern("/v1/experimental/permissions/bulkcheckpermission")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ExperimentalService_BulkCheckPermission_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentalService_BulkCheckPermission_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -205,6 +296,50 @@ func RegisterExperimentalServiceHandlerClient(ctx context.Context, mux *runtime. }) + mux.Handle("POST", pattern_ExperimentalService_StreamingBulkCheckPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/authzed.api.v1.ExperimentalService/StreamingBulkCheckPermission", runtime.WithHTTPPathPattern("/v1/experimental/permissions/streamingbulkcheckpermission")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentalService_StreamingBulkCheckPermission_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentalService_StreamingBulkCheckPermission_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ExperimentalService_BulkCheckPermission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/authzed.api.v1.ExperimentalService/BulkCheckPermission", runtime.WithHTTPPathPattern("/v1/experimental/permissions/bulkcheckpermission")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ExperimentalService_BulkCheckPermission_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ExperimentalService_BulkCheckPermission_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -212,10 +347,18 @@ var ( pattern_ExperimentalService_BulkImportRelationships_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "experimental", "relationships", "bulkimport"}, "")) pattern_ExperimentalService_BulkExportRelationships_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "experimental", "relationships", "bulkexport"}, "")) + + pattern_ExperimentalService_StreamingBulkCheckPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "experimental", "permissions", "streamingbulkcheckpermission"}, "")) + + pattern_ExperimentalService_BulkCheckPermission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "experimental", "permissions", "bulkcheckpermission"}, "")) ) var ( forward_ExperimentalService_BulkImportRelationships_0 = runtime.ForwardResponseMessage forward_ExperimentalService_BulkExportRelationships_0 = runtime.ForwardResponseStream + + forward_ExperimentalService_StreamingBulkCheckPermission_0 = runtime.ForwardResponseStream + + forward_ExperimentalService_BulkCheckPermission_0 = runtime.ForwardResponseMessage ) diff --git a/proto/authzed/api/v1/experimental_service.pb.validate.go b/proto/authzed/api/v1/experimental_service.pb.validate.go index aef79db..d5c8ac7 100644 --- a/proto/authzed/api/v1/experimental_service.pb.validate.go +++ b/proto/authzed/api/v1/experimental_service.pb.validate.go @@ -35,6 +35,1271 @@ var ( _ = sort.Sort ) +// Validate checks the field values on StreamingBulkCheckPermissionRequest with +// the rules defined in the proto definition for this message. If any rules +// are violated, the first error encountered is returned, or nil if there are +// no violations. +func (m *StreamingBulkCheckPermissionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StreamingBulkCheckPermissionRequest +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// StreamingBulkCheckPermissionRequestMultiError, or nil if none found. +func (m *StreamingBulkCheckPermissionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *StreamingBulkCheckPermissionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetConsistency()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsistency()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamingBulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if item == nil { + err := StreamingBulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamingBulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return StreamingBulkCheckPermissionRequestMultiError(errors) + } + + return nil +} + +// StreamingBulkCheckPermissionRequestMultiError is an error wrapping multiple +// validation errors returned by +// StreamingBulkCheckPermissionRequest.ValidateAll() if the designated +// constraints aren't met. +type StreamingBulkCheckPermissionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StreamingBulkCheckPermissionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StreamingBulkCheckPermissionRequestMultiError) AllErrors() []error { return m } + +// StreamingBulkCheckPermissionRequestValidationError is the validation error +// returned by StreamingBulkCheckPermissionRequest.Validate if the designated +// constraints aren't met. +type StreamingBulkCheckPermissionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StreamingBulkCheckPermissionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StreamingBulkCheckPermissionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StreamingBulkCheckPermissionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StreamingBulkCheckPermissionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StreamingBulkCheckPermissionRequestValidationError) ErrorName() string { + return "StreamingBulkCheckPermissionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e StreamingBulkCheckPermissionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStreamingBulkCheckPermissionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StreamingBulkCheckPermissionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StreamingBulkCheckPermissionRequestValidationError{} + +// Validate checks the field values on BulkCheckPermissionRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *BulkCheckPermissionRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BulkCheckPermissionRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// BulkCheckPermissionRequestMultiError, or nil if none found. +func (m *BulkCheckPermissionRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *BulkCheckPermissionRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetConsistency()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetConsistency()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionRequestValidationError{ + field: "Consistency", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetItems() { + _, _ = idx, item + + if item == nil { + err := BulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionRequestValidationError{ + field: fmt.Sprintf("Items[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return BulkCheckPermissionRequestMultiError(errors) + } + + return nil +} + +// BulkCheckPermissionRequestMultiError is an error wrapping multiple +// validation errors returned by BulkCheckPermissionRequest.ValidateAll() if +// the designated constraints aren't met. +type BulkCheckPermissionRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BulkCheckPermissionRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BulkCheckPermissionRequestMultiError) AllErrors() []error { return m } + +// BulkCheckPermissionRequestValidationError is the validation error returned +// by BulkCheckPermissionRequest.Validate if the designated constraints aren't met. +type BulkCheckPermissionRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BulkCheckPermissionRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BulkCheckPermissionRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BulkCheckPermissionRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BulkCheckPermissionRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BulkCheckPermissionRequestValidationError) ErrorName() string { + return "BulkCheckPermissionRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e BulkCheckPermissionRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBulkCheckPermissionRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BulkCheckPermissionRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BulkCheckPermissionRequestValidationError{} + +// Validate checks the field values on BulkCheckPermissionRequestItem with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *BulkCheckPermissionRequestItem) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BulkCheckPermissionRequestItem with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// BulkCheckPermissionRequestItemMultiError, or nil if none found. +func (m *BulkCheckPermissionRequestItem) ValidateAll() error { + return m.validate(true) +} + +func (m *BulkCheckPermissionRequestItem) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetResource() == nil { + err := BulkCheckPermissionRequestItemValidationError{ + field: "Resource", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetResource()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResource()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionRequestItemValidationError{ + field: "Resource", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(m.GetPermission()) > 64 { + err := BulkCheckPermissionRequestItemValidationError{ + field: "Permission", + reason: "value length must be at most 64 bytes", + } + if !all { + return err + } + errors = append(errors, err) + } + + if !_BulkCheckPermissionRequestItem_Permission_Pattern.MatchString(m.GetPermission()) { + err := BulkCheckPermissionRequestItemValidationError{ + field: "Permission", + reason: "value does not match regex pattern \"^([a-z][a-z0-9_]{1,62}[a-z0-9])?$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetSubject() == nil { + err := BulkCheckPermissionRequestItemValidationError{ + field: "Subject", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetSubject()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Subject", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Subject", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetSubject()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionRequestItemValidationError{ + field: "Subject", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetContext()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Context", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionRequestItemValidationError{ + field: "Context", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContext()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionRequestItemValidationError{ + field: "Context", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BulkCheckPermissionRequestItemMultiError(errors) + } + + return nil +} + +// BulkCheckPermissionRequestItemMultiError is an error wrapping multiple +// validation errors returned by BulkCheckPermissionRequestItem.ValidateAll() +// if the designated constraints aren't met. +type BulkCheckPermissionRequestItemMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BulkCheckPermissionRequestItemMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BulkCheckPermissionRequestItemMultiError) AllErrors() []error { return m } + +// BulkCheckPermissionRequestItemValidationError is the validation error +// returned by BulkCheckPermissionRequestItem.Validate if the designated +// constraints aren't met. +type BulkCheckPermissionRequestItemValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BulkCheckPermissionRequestItemValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BulkCheckPermissionRequestItemValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BulkCheckPermissionRequestItemValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BulkCheckPermissionRequestItemValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BulkCheckPermissionRequestItemValidationError) ErrorName() string { + return "BulkCheckPermissionRequestItemValidationError" +} + +// Error satisfies the builtin error interface +func (e BulkCheckPermissionRequestItemValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBulkCheckPermissionRequestItem.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BulkCheckPermissionRequestItemValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BulkCheckPermissionRequestItemValidationError{} + +var _BulkCheckPermissionRequestItem_Permission_Pattern = regexp.MustCompile("^([a-z][a-z0-9_]{1,62}[a-z0-9])?$") + +// Validate checks the field values on BulkCheckPermissionResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *BulkCheckPermissionResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BulkCheckPermissionResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// BulkCheckPermissionResponseMultiError, or nil if none found. +func (m *BulkCheckPermissionResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *BulkCheckPermissionResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetCheckedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCheckedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetPairs() { + _, _ = idx, item + + if item == nil { + err := BulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return BulkCheckPermissionResponseMultiError(errors) + } + + return nil +} + +// BulkCheckPermissionResponseMultiError is an error wrapping multiple +// validation errors returned by BulkCheckPermissionResponse.ValidateAll() if +// the designated constraints aren't met. +type BulkCheckPermissionResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BulkCheckPermissionResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BulkCheckPermissionResponseMultiError) AllErrors() []error { return m } + +// BulkCheckPermissionResponseValidationError is the validation error returned +// by BulkCheckPermissionResponse.Validate if the designated constraints +// aren't met. +type BulkCheckPermissionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BulkCheckPermissionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BulkCheckPermissionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BulkCheckPermissionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BulkCheckPermissionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BulkCheckPermissionResponseValidationError) ErrorName() string { + return "BulkCheckPermissionResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e BulkCheckPermissionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBulkCheckPermissionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BulkCheckPermissionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BulkCheckPermissionResponseValidationError{} + +// Validate checks the field values on StreamingBulkCheckPermissionResponse +// with the rules defined in the proto definition for this message. If any +// rules are violated, the first error encountered is returned, or nil if +// there are no violations. +func (m *StreamingBulkCheckPermissionResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StreamingBulkCheckPermissionResponse +// with the rules defined in the proto definition for this message. If any +// rules are violated, the result is a list of violation errors wrapped in +// StreamingBulkCheckPermissionResponseMultiError, or nil if none found. +func (m *StreamingBulkCheckPermissionResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *StreamingBulkCheckPermissionResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetCheckedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCheckedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamingBulkCheckPermissionResponseValidationError{ + field: "CheckedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetPairs() { + _, _ = idx, item + + if item == nil { + err := StreamingBulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StreamingBulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StreamingBulkCheckPermissionResponseValidationError{ + field: fmt.Sprintf("Pairs[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return StreamingBulkCheckPermissionResponseMultiError(errors) + } + + return nil +} + +// StreamingBulkCheckPermissionResponseMultiError is an error wrapping multiple +// validation errors returned by +// StreamingBulkCheckPermissionResponse.ValidateAll() if the designated +// constraints aren't met. +type StreamingBulkCheckPermissionResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StreamingBulkCheckPermissionResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StreamingBulkCheckPermissionResponseMultiError) AllErrors() []error { return m } + +// StreamingBulkCheckPermissionResponseValidationError is the validation error +// returned by StreamingBulkCheckPermissionResponse.Validate if the designated +// constraints aren't met. +type StreamingBulkCheckPermissionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StreamingBulkCheckPermissionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StreamingBulkCheckPermissionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StreamingBulkCheckPermissionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StreamingBulkCheckPermissionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StreamingBulkCheckPermissionResponseValidationError) ErrorName() string { + return "StreamingBulkCheckPermissionResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e StreamingBulkCheckPermissionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStreamingBulkCheckPermissionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StreamingBulkCheckPermissionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StreamingBulkCheckPermissionResponseValidationError{} + +// Validate checks the field values on BulkCheckPermissionPair with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *BulkCheckPermissionPair) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BulkCheckPermissionPair with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// BulkCheckPermissionPairMultiError, or nil if none found. +func (m *BulkCheckPermissionPair) ValidateAll() error { + return m.validate(true) +} + +func (m *BulkCheckPermissionPair) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetRequest()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionPairValidationError{ + field: "Request", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionPairValidationError{ + field: "Request", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRequest()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionPairValidationError{ + field: "Request", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionPairValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionPairValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionPairValidationError{ + field: "Response", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BulkCheckPermissionPairMultiError(errors) + } + + return nil +} + +// BulkCheckPermissionPairMultiError is an error wrapping multiple validation +// errors returned by BulkCheckPermissionPair.ValidateAll() if the designated +// constraints aren't met. +type BulkCheckPermissionPairMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BulkCheckPermissionPairMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BulkCheckPermissionPairMultiError) AllErrors() []error { return m } + +// BulkCheckPermissionPairValidationError is the validation error returned by +// BulkCheckPermissionPair.Validate if the designated constraints aren't met. +type BulkCheckPermissionPairValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BulkCheckPermissionPairValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BulkCheckPermissionPairValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BulkCheckPermissionPairValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BulkCheckPermissionPairValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BulkCheckPermissionPairValidationError) ErrorName() string { + return "BulkCheckPermissionPairValidationError" +} + +// Error satisfies the builtin error interface +func (e BulkCheckPermissionPairValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBulkCheckPermissionPair.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BulkCheckPermissionPairValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BulkCheckPermissionPairValidationError{} + +// Validate checks the field values on BulkCheckPermissionResponseItem with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *BulkCheckPermissionResponseItem) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BulkCheckPermissionResponseItem with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// BulkCheckPermissionResponseItemMultiError, or nil if none found. +func (m *BulkCheckPermissionResponseItem) ValidateAll() error { + return m.validate(true) +} + +func (m *BulkCheckPermissionResponseItem) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if _, ok := _BulkCheckPermissionResponseItem_Permissionship_NotInLookup[m.GetPermissionship()]; ok { + err := BulkCheckPermissionResponseItemValidationError{ + field: "Permissionship", + reason: "value must not be in list [PERMISSIONSHIP_UNSPECIFIED]", + } + if !all { + return err + } + errors = append(errors, err) + } + + if _, ok := CheckPermissionResponse_Permissionship_name[int32(m.GetPermissionship())]; !ok { + err := BulkCheckPermissionResponseItemValidationError{ + field: "Permissionship", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetPartialCaveatInfo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BulkCheckPermissionResponseItemValidationError{ + field: "PartialCaveatInfo", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BulkCheckPermissionResponseItemValidationError{ + field: "PartialCaveatInfo", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetPartialCaveatInfo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BulkCheckPermissionResponseItemValidationError{ + field: "PartialCaveatInfo", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return BulkCheckPermissionResponseItemMultiError(errors) + } + + return nil +} + +// BulkCheckPermissionResponseItemMultiError is an error wrapping multiple +// validation errors returned by BulkCheckPermissionResponseItem.ValidateAll() +// if the designated constraints aren't met. +type BulkCheckPermissionResponseItemMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BulkCheckPermissionResponseItemMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m BulkCheckPermissionResponseItemMultiError) AllErrors() []error { return m } + +// BulkCheckPermissionResponseItemValidationError is the validation error +// returned by BulkCheckPermissionResponseItem.Validate if the designated +// constraints aren't met. +type BulkCheckPermissionResponseItemValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BulkCheckPermissionResponseItemValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BulkCheckPermissionResponseItemValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BulkCheckPermissionResponseItemValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BulkCheckPermissionResponseItemValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BulkCheckPermissionResponseItemValidationError) ErrorName() string { + return "BulkCheckPermissionResponseItemValidationError" +} + +// Error satisfies the builtin error interface +func (e BulkCheckPermissionResponseItemValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sBulkCheckPermissionResponseItem.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BulkCheckPermissionResponseItemValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BulkCheckPermissionResponseItemValidationError{} + +var _BulkCheckPermissionResponseItem_Permissionship_NotInLookup = map[CheckPermissionResponse_Permissionship]struct{}{ + 0: {}, +} + // Validate checks the field values on BulkImportRelationshipsRequest with the // rules defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. diff --git a/proto/authzed/api/v1/experimental_service_grpc.pb.go b/proto/authzed/api/v1/experimental_service_grpc.pb.go index 7a3e97d..667185b 100644 --- a/proto/authzed/api/v1/experimental_service_grpc.pb.go +++ b/proto/authzed/api/v1/experimental_service_grpc.pb.go @@ -19,8 +19,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ExperimentalService_BulkImportRelationships_FullMethodName = "/authzed.api.v1.ExperimentalService/BulkImportRelationships" - ExperimentalService_BulkExportRelationships_FullMethodName = "/authzed.api.v1.ExperimentalService/BulkExportRelationships" + ExperimentalService_BulkImportRelationships_FullMethodName = "/authzed.api.v1.ExperimentalService/BulkImportRelationships" + ExperimentalService_BulkExportRelationships_FullMethodName = "/authzed.api.v1.ExperimentalService/BulkExportRelationships" + ExperimentalService_StreamingBulkCheckPermission_FullMethodName = "/authzed.api.v1.ExperimentalService/StreamingBulkCheckPermission" + ExperimentalService_BulkCheckPermission_FullMethodName = "/authzed.api.v1.ExperimentalService/BulkCheckPermission" ) // ExperimentalServiceClient is the client API for ExperimentalService service. @@ -41,6 +43,8 @@ type ExperimentalServiceClient interface { // relationships from the server. It is resumable, and will return results // in an order determined by the server. BulkExportRelationships(ctx context.Context, in *BulkExportRelationshipsRequest, opts ...grpc.CallOption) (ExperimentalService_BulkExportRelationshipsClient, error) + StreamingBulkCheckPermission(ctx context.Context, in *StreamingBulkCheckPermissionRequest, opts ...grpc.CallOption) (ExperimentalService_StreamingBulkCheckPermissionClient, error) + BulkCheckPermission(ctx context.Context, in *BulkCheckPermissionRequest, opts ...grpc.CallOption) (*BulkCheckPermissionResponse, error) } type experimentalServiceClient struct { @@ -117,6 +121,47 @@ func (x *experimentalServiceBulkExportRelationshipsClient) Recv() (*BulkExportRe return m, nil } +func (c *experimentalServiceClient) StreamingBulkCheckPermission(ctx context.Context, in *StreamingBulkCheckPermissionRequest, opts ...grpc.CallOption) (ExperimentalService_StreamingBulkCheckPermissionClient, error) { + stream, err := c.cc.NewStream(ctx, &ExperimentalService_ServiceDesc.Streams[2], ExperimentalService_StreamingBulkCheckPermission_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &experimentalServiceStreamingBulkCheckPermissionClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ExperimentalService_StreamingBulkCheckPermissionClient interface { + Recv() (*StreamingBulkCheckPermissionResponse, error) + grpc.ClientStream +} + +type experimentalServiceStreamingBulkCheckPermissionClient struct { + grpc.ClientStream +} + +func (x *experimentalServiceStreamingBulkCheckPermissionClient) Recv() (*StreamingBulkCheckPermissionResponse, error) { + m := new(StreamingBulkCheckPermissionResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *experimentalServiceClient) BulkCheckPermission(ctx context.Context, in *BulkCheckPermissionRequest, opts ...grpc.CallOption) (*BulkCheckPermissionResponse, error) { + out := new(BulkCheckPermissionResponse) + err := c.cc.Invoke(ctx, ExperimentalService_BulkCheckPermission_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ExperimentalServiceServer is the server API for ExperimentalService service. // All implementations must embed UnimplementedExperimentalServiceServer // for forward compatibility @@ -135,6 +180,8 @@ type ExperimentalServiceServer interface { // relationships from the server. It is resumable, and will return results // in an order determined by the server. BulkExportRelationships(*BulkExportRelationshipsRequest, ExperimentalService_BulkExportRelationshipsServer) error + StreamingBulkCheckPermission(*StreamingBulkCheckPermissionRequest, ExperimentalService_StreamingBulkCheckPermissionServer) error + BulkCheckPermission(context.Context, *BulkCheckPermissionRequest) (*BulkCheckPermissionResponse, error) mustEmbedUnimplementedExperimentalServiceServer() } @@ -148,6 +195,12 @@ func (UnimplementedExperimentalServiceServer) BulkImportRelationships(Experiment func (UnimplementedExperimentalServiceServer) BulkExportRelationships(*BulkExportRelationshipsRequest, ExperimentalService_BulkExportRelationshipsServer) error { return status.Errorf(codes.Unimplemented, "method BulkExportRelationships not implemented") } +func (UnimplementedExperimentalServiceServer) StreamingBulkCheckPermission(*StreamingBulkCheckPermissionRequest, ExperimentalService_StreamingBulkCheckPermissionServer) error { + return status.Errorf(codes.Unimplemented, "method StreamingBulkCheckPermission not implemented") +} +func (UnimplementedExperimentalServiceServer) BulkCheckPermission(context.Context, *BulkCheckPermissionRequest) (*BulkCheckPermissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BulkCheckPermission not implemented") +} func (UnimplementedExperimentalServiceServer) mustEmbedUnimplementedExperimentalServiceServer() {} // UnsafeExperimentalServiceServer may be embedded to opt out of forward compatibility for this service. @@ -208,13 +261,57 @@ func (x *experimentalServiceBulkExportRelationshipsServer) Send(m *BulkExportRel return x.ServerStream.SendMsg(m) } +func _ExperimentalService_StreamingBulkCheckPermission_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamingBulkCheckPermissionRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ExperimentalServiceServer).StreamingBulkCheckPermission(m, &experimentalServiceStreamingBulkCheckPermissionServer{stream}) +} + +type ExperimentalService_StreamingBulkCheckPermissionServer interface { + Send(*StreamingBulkCheckPermissionResponse) error + grpc.ServerStream +} + +type experimentalServiceStreamingBulkCheckPermissionServer struct { + grpc.ServerStream +} + +func (x *experimentalServiceStreamingBulkCheckPermissionServer) Send(m *StreamingBulkCheckPermissionResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ExperimentalService_BulkCheckPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BulkCheckPermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExperimentalServiceServer).BulkCheckPermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExperimentalService_BulkCheckPermission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExperimentalServiceServer).BulkCheckPermission(ctx, req.(*BulkCheckPermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ExperimentalService_ServiceDesc is the grpc.ServiceDesc for ExperimentalService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ExperimentalService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "authzed.api.v1.ExperimentalService", HandlerType: (*ExperimentalServiceServer)(nil), - Methods: []grpc.MethodDesc{}, + Methods: []grpc.MethodDesc{ + { + MethodName: "BulkCheckPermission", + Handler: _ExperimentalService_BulkCheckPermission_Handler, + }, + }, Streams: []grpc.StreamDesc{ { StreamName: "BulkImportRelationships", @@ -226,6 +323,11 @@ var ExperimentalService_ServiceDesc = grpc.ServiceDesc{ Handler: _ExperimentalService_BulkExportRelationships_Handler, ServerStreams: true, }, + { + StreamName: "StreamingBulkCheckPermission", + Handler: _ExperimentalService_StreamingBulkCheckPermission_Handler, + ServerStreams: true, + }, }, Metadata: "authzed/api/v1/experimental_service.proto", } diff --git a/proto/authzed/api/v1/experimental_service_vtproto.pb.go b/proto/authzed/api/v1/experimental_service_vtproto.pb.go index 6d05da1..46b0eb8 100644 --- a/proto/authzed/api/v1/experimental_service_vtproto.pb.go +++ b/proto/authzed/api/v1/experimental_service_vtproto.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" io "io" ) @@ -18,6 +19,171 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +func (m *StreamingBulkCheckPermissionRequest) CloneVT() *StreamingBulkCheckPermissionRequest { + if m == nil { + return (*StreamingBulkCheckPermissionRequest)(nil) + } + r := &StreamingBulkCheckPermissionRequest{ + Consistency: m.Consistency.CloneVT(), + } + if rhs := m.Items; rhs != nil { + tmpContainer := make([]*BulkCheckPermissionRequestItem, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Items = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamingBulkCheckPermissionRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BulkCheckPermissionRequest) CloneVT() *BulkCheckPermissionRequest { + if m == nil { + return (*BulkCheckPermissionRequest)(nil) + } + r := &BulkCheckPermissionRequest{ + Consistency: m.Consistency.CloneVT(), + } + if rhs := m.Items; rhs != nil { + tmpContainer := make([]*BulkCheckPermissionRequestItem, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Items = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BulkCheckPermissionRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BulkCheckPermissionRequestItem) CloneVT() *BulkCheckPermissionRequestItem { + if m == nil { + return (*BulkCheckPermissionRequestItem)(nil) + } + r := &BulkCheckPermissionRequestItem{ + Resource: m.Resource.CloneVT(), + Permission: m.Permission, + Subject: m.Subject.CloneVT(), + } + if rhs := m.Context; rhs != nil { + if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *structpb.Struct }); ok { + r.Context = vtpb.CloneVT() + } else { + r.Context = proto.Clone(rhs).(*structpb.Struct) + } + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BulkCheckPermissionRequestItem) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BulkCheckPermissionResponse) CloneVT() *BulkCheckPermissionResponse { + if m == nil { + return (*BulkCheckPermissionResponse)(nil) + } + r := &BulkCheckPermissionResponse{ + CheckedAt: m.CheckedAt.CloneVT(), + } + if rhs := m.Pairs; rhs != nil { + tmpContainer := make([]*BulkCheckPermissionPair, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Pairs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BulkCheckPermissionResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StreamingBulkCheckPermissionResponse) CloneVT() *StreamingBulkCheckPermissionResponse { + if m == nil { + return (*StreamingBulkCheckPermissionResponse)(nil) + } + r := &StreamingBulkCheckPermissionResponse{ + CheckedAt: m.CheckedAt.CloneVT(), + } + if rhs := m.Pairs; rhs != nil { + tmpContainer := make([]*BulkCheckPermissionPair, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Pairs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StreamingBulkCheckPermissionResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BulkCheckPermissionPair) CloneVT() *BulkCheckPermissionPair { + if m == nil { + return (*BulkCheckPermissionPair)(nil) + } + r := &BulkCheckPermissionPair{ + Request: m.Request.CloneVT(), + Response: m.Response.CloneVT(), + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BulkCheckPermissionPair) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BulkCheckPermissionResponseItem) CloneVT() *BulkCheckPermissionResponseItem { + if m == nil { + return (*BulkCheckPermissionResponseItem)(nil) + } + r := &BulkCheckPermissionResponseItem{ + Permissionship: m.Permissionship, + PartialCaveatInfo: m.PartialCaveatInfo.CloneVT(), + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BulkCheckPermissionResponseItem) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *BulkImportRelationshipsRequest) CloneVT() *BulkImportRelationshipsRequest { if m == nil { return (*BulkImportRelationshipsRequest)(nil) @@ -104,7 +270,7 @@ func (m *BulkExportRelationshipsResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *BulkImportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { +func (m *StreamingBulkCheckPermissionRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -117,12 +283,12 @@ func (m *BulkImportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BulkImportRelationshipsRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *StreamingBulkCheckPermissionRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkImportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *StreamingBulkCheckPermissionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -134,22 +300,32 @@ func (m *BulkImportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Relationships) > 0 { - for iNdEx := len(m.Relationships) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Relationships[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Items[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + } + if m.Consistency != nil { + size, err := m.Consistency.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BulkImportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { +func (m *BulkCheckPermissionRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -162,12 +338,12 @@ func (m *BulkImportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BulkImportRelationshipsResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkImportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -179,15 +355,32 @@ func (m *BulkImportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.NumLoaded != 0 { - i = encodeVarint(dAtA, i, uint64(m.NumLoaded)) + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Items[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.Consistency != nil { + size, err := m.Consistency.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *BulkExportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { +func (m *BulkCheckPermissionRequestItem) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -200,12 +393,12 @@ func (m *BulkExportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BulkExportRelationshipsRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionRequestItem) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkExportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionRequestItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -217,8 +410,30 @@ func (m *BulkExportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.OptionalCursor != nil { - size, err := m.OptionalCursor.MarshalToSizedBufferVT(dAtA[:i]) + if m.Context != nil { + if vtmsg, ok := interface{}(m.Context).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.Context) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = encodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x22 + } + if m.Subject != nil { + size, err := m.Subject.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -227,13 +442,15 @@ func (m *BulkExportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (in i-- dAtA[i] = 0x1a } - if m.OptionalLimit != 0 { - i = encodeVarint(dAtA, i, uint64(m.OptionalLimit)) + if len(m.Permission) > 0 { + i -= len(m.Permission) + copy(dAtA[i:], m.Permission) + i = encodeVarint(dAtA, i, uint64(len(m.Permission))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.Consistency != nil { - size, err := m.Consistency.MarshalToSizedBufferVT(dAtA[:i]) + if m.Resource != nil { + size, err := m.Resource.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -245,7 +462,7 @@ func (m *BulkExportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *BulkExportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { +func (m *BulkCheckPermissionResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -258,12 +475,12 @@ func (m *BulkExportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BulkExportRelationshipsResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkExportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *BulkCheckPermissionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -275,9 +492,9 @@ func (m *BulkExportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (i i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Relationships) > 0 { - for iNdEx := len(m.Relationships) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Relationships[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Pairs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -287,8 +504,8 @@ func (m *BulkExportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (i dAtA[i] = 0x12 } } - if m.AfterResultCursor != nil { - size, err := m.AfterResultCursor.MarshalToSizedBufferVT(dAtA[:i]) + if m.CheckedAt != nil { + size, err := m.CheckedAt.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -300,76 +517,1487 @@ func (m *BulkExportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *BulkImportRelationshipsRequest) SizeVT() (n int) { +func (m *StreamingBulkCheckPermissionResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - if len(m.Relationships) > 0 { - for _, e := range m.Relationships { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *BulkImportRelationshipsResponse) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NumLoaded != 0 { - n += 1 + sov(uint64(m.NumLoaded)) - } - n += len(m.unknownFields) - return n +func (m *StreamingBulkCheckPermissionResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *BulkExportRelationshipsRequest) SizeVT() (n int) { +func (m *StreamingBulkCheckPermissionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if m.Consistency != nil { - l = m.Consistency.SizeVT() - n += 1 + l + sov(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - if m.OptionalLimit != 0 { - n += 1 + sov(uint64(m.OptionalLimit)) + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Pairs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } } - if m.OptionalCursor != nil { - l = m.OptionalCursor.SizeVT() - n += 1 + l + sov(uint64(l)) + if m.CheckedAt != nil { + size, err := m.CheckedAt.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - n += len(m.unknownFields) - return n + return len(dAtA) - i, nil } -func (m *BulkExportRelationshipsResponse) SizeVT() (n int) { +func (m *BulkCheckPermissionPair) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 - } - var l int - _ = l - if m.AfterResultCursor != nil { - l = m.AfterResultCursor.SizeVT() - n += 1 + l + sov(uint64(l)) + return nil, nil } - if len(m.Relationships) > 0 { - for _, e := range m.Relationships { - l = e.SizeVT() + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkCheckPermissionPair) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkCheckPermissionPair) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Response != nil { + size, err := m.Response.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Request != nil { + size, err := m.Request.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BulkCheckPermissionResponseItem) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkCheckPermissionResponseItem) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkCheckPermissionResponseItem) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PartialCaveatInfo != nil { + size, err := m.PartialCaveatInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Permissionship != 0 { + i = encodeVarint(dAtA, i, uint64(m.Permissionship)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *BulkImportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkImportRelationshipsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkImportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Relationships) > 0 { + for iNdEx := len(m.Relationships) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Relationships[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *BulkImportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkImportRelationshipsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkImportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.NumLoaded != 0 { + i = encodeVarint(dAtA, i, uint64(m.NumLoaded)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BulkExportRelationshipsRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkExportRelationshipsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkExportRelationshipsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.OptionalCursor != nil { + size, err := m.OptionalCursor.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.OptionalLimit != 0 { + i = encodeVarint(dAtA, i, uint64(m.OptionalLimit)) + i-- + dAtA[i] = 0x10 + } + if m.Consistency != nil { + size, err := m.Consistency.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BulkExportRelationshipsResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BulkExportRelationshipsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BulkExportRelationshipsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Relationships) > 0 { + for iNdEx := len(m.Relationships) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Relationships[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.AfterResultCursor != nil { + size, err := m.AfterResultCursor.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StreamingBulkCheckPermissionRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Consistency != nil { + l = m.Consistency.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BulkCheckPermissionRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Consistency != nil { + l = m.Consistency.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BulkCheckPermissionRequestItem) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resource != nil { + l = m.Resource.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.Permission) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Subject != nil { + l = m.Subject.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Context != nil { + if size, ok := interface{}(m.Context).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.Context) + } + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BulkCheckPermissionResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckedAt != nil { + l = m.CheckedAt.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *StreamingBulkCheckPermissionResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CheckedAt != nil { + l = m.CheckedAt.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BulkCheckPermissionPair) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Response != nil { + l = m.Response.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BulkCheckPermissionResponseItem) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Permissionship != 0 { + n += 1 + sov(uint64(m.Permissionship)) + } + if m.PartialCaveatInfo != nil { + l = m.PartialCaveatInfo.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BulkImportRelationshipsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Relationships) > 0 { + for _, e := range m.Relationships { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BulkImportRelationshipsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NumLoaded != 0 { + n += 1 + sov(uint64(m.NumLoaded)) + } + n += len(m.unknownFields) + return n +} + +func (m *BulkExportRelationshipsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Consistency != nil { + l = m.Consistency.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.OptionalLimit != 0 { + n += 1 + sov(uint64(m.OptionalLimit)) + } + if m.OptionalCursor != nil { + l = m.OptionalCursor.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BulkExportRelationshipsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AfterResultCursor != nil { + l = m.AfterResultCursor.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Relationships) > 0 { + for _, e := range m.Relationships { + l = e.SizeVT() n += 1 + l + sov(uint64(l)) } } - n += len(m.unknownFields) - return n + n += len(m.unknownFields) + return n +} + +func (m *StreamingBulkCheckPermissionRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StreamingBulkCheckPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamingBulkCheckPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consistency", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consistency == nil { + m.Consistency = &Consistency{} + } + if err := m.Consistency.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, &BulkCheckPermissionRequestItem{}) + if err := m.Items[len(m.Items)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BulkCheckPermissionRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkCheckPermissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkCheckPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consistency", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consistency == nil { + m.Consistency = &Consistency{} + } + if err := m.Consistency.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, &BulkCheckPermissionRequestItem{}) + if err := m.Items[len(m.Items)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BulkCheckPermissionRequestItem) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkCheckPermissionRequestItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkCheckPermissionRequestItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = &ObjectReference{} + } + if err := m.Resource.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Subject == nil { + m.Subject = &SubjectReference{} + } + if err := m.Subject.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Context == nil { + m.Context = &structpb.Struct{} + } + if unmarshal, ok := interface{}(m.Context).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Context); err != nil { + return err + } + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BulkCheckPermissionResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkCheckPermissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkCheckPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CheckedAt == nil { + m.CheckedAt = &ZedToken{} + } + if err := m.CheckedAt.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, &BulkCheckPermissionPair{}) + if err := m.Pairs[len(m.Pairs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StreamingBulkCheckPermissionResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StreamingBulkCheckPermissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamingBulkCheckPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CheckedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CheckedAt == nil { + m.CheckedAt = &ZedToken{} + } + if err := m.CheckedAt.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, &BulkCheckPermissionPair{}) + if err := m.Pairs[len(m.Pairs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BulkCheckPermissionPair) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkCheckPermissionPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkCheckPermissionPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Request == nil { + m.Request = &BulkCheckPermissionRequestItem{} + } + if err := m.Request.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &BulkCheckPermissionResponseItem{} + } + if err := m.Response.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } +func (m *BulkCheckPermissionResponseItem) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BulkCheckPermissionResponseItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BulkCheckPermissionResponseItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissionship", wireType) + } + m.Permissionship = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Permissionship |= CheckPermissionResponse_Permissionship(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialCaveatInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PartialCaveatInfo == nil { + m.PartialCaveatInfo = &PartialCaveatInfo{} + } + if err := m.PartialCaveatInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *BulkImportRelationshipsRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/authzed/api/v1/zz_generated.version.go b/proto/authzed/api/v1/zz_generated.version.go index aa41d41..908b036 100644 --- a/proto/authzed/api/v1/zz_generated.version.go +++ b/proto/authzed/api/v1/zz_generated.version.go @@ -2,5 +2,5 @@ package v1 const ( BufRepository = "buf.build/authzed/api" - BufTag = "dc592e107033a7a4336935cf94fb90426719508d" + BufTag = "da9870cabdeeb5b2ac48f1bd030409037bff6a76" ) diff --git a/proto/authzed/api/v1alpha1/zz_generated.version.go b/proto/authzed/api/v1alpha1/zz_generated.version.go index 677f51d..14522cf 100644 --- a/proto/authzed/api/v1alpha1/zz_generated.version.go +++ b/proto/authzed/api/v1alpha1/zz_generated.version.go @@ -2,5 +2,5 @@ package v1alpha1 const ( BufRepository = "buf.build/authzed/api" - BufTag = "dc592e107033a7a4336935cf94fb90426719508d" + BufTag = "da9870cabdeeb5b2ac48f1bd030409037bff6a76" )