diff --git a/proto/ory/keto/opl/v1alpha1/syntax_service.pb.go b/proto/ory/keto/opl/v1alpha1/syntax_service.pb.go index cc740fe62..879ed0959 100644 --- a/proto/ory/keto/opl/v1alpha1/syntax_service.pb.go +++ b/proto/ory/keto/opl/v1alpha1/syntax_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/opl/v1alpha1/syntax_service.proto @@ -30,11 +30,9 @@ type CheckRequest struct { func (x *CheckRequest) Reset() { *x = CheckRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CheckRequest) String() string { @@ -45,7 +43,7 @@ func (*CheckRequest) ProtoMessage() {} func (x *CheckRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -77,11 +75,9 @@ type CheckResponse struct { func (x *CheckResponse) Reset() { *x = CheckResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CheckResponse) String() string { @@ -92,7 +88,7 @@ func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -126,11 +122,9 @@ type ParseError struct { func (x *ParseError) Reset() { *x = ParseError{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ParseError) String() string { @@ -141,7 +135,7 @@ func (*ParseError) ProtoMessage() {} func (x *ParseError) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -188,11 +182,9 @@ type SourcePosition struct { func (x *SourcePosition) Reset() { *x = SourcePosition{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SourcePosition) String() string { @@ -203,7 +195,7 @@ func (*SourcePosition) ProtoMessage() {} func (x *SourcePosition) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -317,56 +309,6 @@ func file_ory_keto_opl_v1alpha1_syntax_service_proto_init() { if File_ory_keto_opl_v1alpha1_syntax_service_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*CheckRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*CheckResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ParseError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_opl_v1alpha1_syntax_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*SourcePosition); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/opl/v1alpha1/syntax_service_grpc.pb.go b/proto/ory/keto/opl/v1alpha1/syntax_service_grpc.pb.go index ed9ffaff9..d0cd8bfab 100644 --- a/proto/ory/keto/opl/v1alpha1/syntax_service_grpc.pb.go +++ b/proto/ory/keto/opl/v1alpha1/syntax_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/opl/v1alpha1/syntax_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( SyntaxService_Check_FullMethodName = "/ory.keto.opl.v1alpha1.SyntaxService/Check" @@ -52,7 +52,7 @@ func (c *syntaxServiceClient) Check(ctx context.Context, in *CheckRequest, opts // SyntaxServiceServer is the server API for SyntaxService service. // All implementations should embed UnimplementedSyntaxServiceServer -// for forward compatibility +// for forward compatibility. // // The service that checks the syntax of an OPL file. type SyntaxServiceServer interface { @@ -60,13 +60,17 @@ type SyntaxServiceServer interface { Check(context.Context, *CheckRequest) (*CheckResponse, error) } -// UnimplementedSyntaxServiceServer should be embedded to have forward compatible implementations. -type UnimplementedSyntaxServiceServer struct { -} +// UnimplementedSyntaxServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedSyntaxServiceServer struct{} func (UnimplementedSyntaxServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") } +func (UnimplementedSyntaxServiceServer) testEmbeddedByValue() {} // UnsafeSyntaxServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SyntaxServiceServer will @@ -76,6 +80,13 @@ type UnsafeSyntaxServiceServer interface { } func RegisterSyntaxServiceServer(s grpc.ServiceRegistrar, srv SyntaxServiceServer) { + // If the following call pancis, it indicates UnimplementedSyntaxServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&SyntaxService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go index b6e9916c9..81b4db663 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/check_service.proto @@ -96,11 +96,9 @@ type CheckRequest struct { func (x *CheckRequest) Reset() { *x = CheckRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CheckRequest) String() string { @@ -111,7 +109,7 @@ func (*CheckRequest) ProtoMessage() {} func (x *CheckRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -215,11 +213,9 @@ type CheckResponse struct { func (x *CheckResponse) Reset() { *x = CheckResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CheckResponse) String() string { @@ -230,7 +226,7 @@ func (*CheckResponse) ProtoMessage() {} func (x *CheckResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -293,11 +289,9 @@ type CheckResponseWithError struct { func (x *CheckResponseWithError) Reset() { *x = CheckResponseWithError{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CheckResponseWithError) String() string { @@ -308,7 +302,7 @@ func (*CheckResponseWithError) ProtoMessage() {} func (x *CheckResponseWithError) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -399,11 +393,9 @@ type BatchCheckRequest struct { func (x *BatchCheckRequest) Reset() { *x = BatchCheckRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BatchCheckRequest) String() string { @@ -414,7 +406,7 @@ func (*BatchCheckRequest) ProtoMessage() {} func (x *BatchCheckRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -470,11 +462,9 @@ type BatchCheckResponse struct { func (x *BatchCheckResponse) Reset() { *x = BatchCheckResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BatchCheckResponse) String() string { @@ -485,7 +475,7 @@ func (*BatchCheckResponse) ProtoMessage() {} func (x *BatchCheckResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -644,68 +634,6 @@ func file_ory_keto_relation_tuples_v1alpha2_check_service_proto_init() { return } file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*CheckRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*CheckResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*CheckResponseWithError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*BatchCheckRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_check_service_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*BatchCheckResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/check_service_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/check_service_grpc.pb.go index 019121301..76f20c2b0 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/check_service_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/check_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/check_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( CheckService_Check_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.CheckService/Check" @@ -67,7 +67,7 @@ func (c *checkServiceClient) BatchCheck(ctx context.Context, in *BatchCheckReque // CheckServiceServer is the server API for CheckService service. // All implementations should embed UnimplementedCheckServiceServer -// for forward compatibility +// for forward compatibility. // // The service that performs authorization checks // based on the stored Access Control Lists. @@ -79,9 +79,12 @@ type CheckServiceServer interface { BatchCheck(context.Context, *BatchCheckRequest) (*BatchCheckResponse, error) } -// UnimplementedCheckServiceServer should be embedded to have forward compatible implementations. -type UnimplementedCheckServiceServer struct { -} +// UnimplementedCheckServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedCheckServiceServer struct{} func (UnimplementedCheckServiceServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") @@ -89,6 +92,7 @@ func (UnimplementedCheckServiceServer) Check(context.Context, *CheckRequest) (*C func (UnimplementedCheckServiceServer) BatchCheck(context.Context, *BatchCheckRequest) (*BatchCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchCheck not implemented") } +func (UnimplementedCheckServiceServer) testEmbeddedByValue() {} // UnsafeCheckServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to CheckServiceServer will @@ -98,6 +102,13 @@ type UnsafeCheckServiceServer interface { } func RegisterCheckServiceServer(s grpc.ServiceRegistrar, srv CheckServiceServer) { + // If the following call pancis, it indicates UnimplementedCheckServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&CheckService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/expand_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/expand_service.pb.go index 937104901..7f01b28e2 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/expand_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/expand_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/expand_service.proto @@ -118,11 +118,9 @@ type ExpandRequest struct { func (x *ExpandRequest) Reset() { *x = ExpandRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExpandRequest) String() string { @@ -133,7 +131,7 @@ func (*ExpandRequest) ProtoMessage() {} func (x *ExpandRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -184,11 +182,9 @@ type ExpandResponse struct { func (x *ExpandResponse) Reset() { *x = ExpandResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExpandResponse) String() string { @@ -199,7 +195,7 @@ func (*ExpandResponse) ProtoMessage() {} func (x *ExpandResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -243,11 +239,9 @@ type SubjectTree struct { func (x *SubjectTree) Reset() { *x = SubjectTree{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SubjectTree) String() string { @@ -258,7 +252,7 @@ func (*SubjectTree) ProtoMessage() {} func (x *SubjectTree) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -424,44 +418,6 @@ func file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_init() { return } file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ExpandRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ExpandResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_expand_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*SubjectTree); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/expand_service_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/expand_service_grpc.pb.go index d7d5dec95..472a3feff 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/expand_service_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/expand_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/expand_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ExpandService_Expand_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.ExpandService/Expand" @@ -55,7 +55,7 @@ func (c *expandServiceClient) Expand(ctx context.Context, in *ExpandRequest, opt // ExpandServiceServer is the server API for ExpandService service. // All implementations should embed UnimplementedExpandServiceServer -// for forward compatibility +// for forward compatibility. // // The service that performs subject set expansion // based on the stored Access Control Lists. @@ -66,13 +66,17 @@ type ExpandServiceServer interface { Expand(context.Context, *ExpandRequest) (*ExpandResponse, error) } -// UnimplementedExpandServiceServer should be embedded to have forward compatible implementations. -type UnimplementedExpandServiceServer struct { -} +// UnimplementedExpandServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedExpandServiceServer struct{} func (UnimplementedExpandServiceServer) Expand(context.Context, *ExpandRequest) (*ExpandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Expand not implemented") } +func (UnimplementedExpandServiceServer) testEmbeddedByValue() {} // UnsafeExpandServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ExpandServiceServer will @@ -82,6 +86,13 @@ type UnsafeExpandServiceServer interface { } func RegisterExpandServiceServer(s grpc.ServiceRegistrar, srv ExpandServiceServer) { + // If the following call pancis, it indicates UnimplementedExpandServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ExpandService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service.pb.go index 63f26619d..11ba57927 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/namespaces_service.proto @@ -29,11 +29,9 @@ type ListNamespacesRequest struct { func (x *ListNamespacesRequest) Reset() { *x = ListNamespacesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListNamespacesRequest) String() string { @@ -44,7 +42,7 @@ func (*ListNamespacesRequest) ProtoMessage() {} func (x *ListNamespacesRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -69,11 +67,9 @@ type ListNamespacesResponse struct { func (x *ListNamespacesResponse) Reset() { *x = ListNamespacesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListNamespacesResponse) String() string { @@ -84,7 +80,7 @@ func (*ListNamespacesResponse) ProtoMessage() {} func (x *ListNamespacesResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -116,11 +112,9 @@ type Namespace struct { func (x *Namespace) Reset() { *x = Namespace{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Namespace) String() string { @@ -131,7 +125,7 @@ func (*Namespace) ProtoMessage() {} func (x *Namespace) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -232,44 +226,6 @@ func file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_init() { if File_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ListNamespacesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ListNamespacesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_namespaces_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Namespace); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service_grpc.pb.go index 4ae30eff8..924825b26 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/namespaces_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/namespaces_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( NamespacesService_ListNamespaces_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.NamespacesService/ListNamespaces" @@ -54,7 +54,7 @@ func (c *namespacesServiceClient) ListNamespaces(ctx context.Context, in *ListNa // NamespacesServiceServer is the server API for NamespacesService service. // All implementations should embed UnimplementedNamespacesServiceServer -// for forward compatibility +// for forward compatibility. // // The service to query namespaces. // @@ -64,13 +64,17 @@ type NamespacesServiceServer interface { ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) } -// UnimplementedNamespacesServiceServer should be embedded to have forward compatible implementations. -type UnimplementedNamespacesServiceServer struct { -} +// UnimplementedNamespacesServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNamespacesServiceServer struct{} func (UnimplementedNamespacesServiceServer) ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListNamespaces not implemented") } +func (UnimplementedNamespacesServiceServer) testEmbeddedByValue() {} // UnsafeNamespacesServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to NamespacesServiceServer will @@ -80,6 +84,13 @@ type UnsafeNamespacesServiceServer interface { } func RegisterNamespacesServiceServer(s grpc.ServiceRegistrar, srv NamespacesServiceServer) { + // If the following call pancis, it indicates UnimplementedNamespacesServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&NamespacesService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go index 26d673394..a463e116e 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/read_service.proto @@ -70,11 +70,9 @@ type ListRelationTuplesRequest struct { func (x *ListRelationTuplesRequest) Reset() { *x = ListRelationTuplesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListRelationTuplesRequest) String() string { @@ -85,7 +83,7 @@ func (*ListRelationTuplesRequest) ProtoMessage() {} func (x *ListRelationTuplesRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -158,11 +156,9 @@ type ListRelationTuplesResponse struct { func (x *ListRelationTuplesResponse) Reset() { *x = ListRelationTuplesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListRelationTuplesResponse) String() string { @@ -173,7 +169,7 @@ func (*ListRelationTuplesResponse) ProtoMessage() {} func (x *ListRelationTuplesResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -229,11 +225,9 @@ type ListRelationTuplesRequest_Query struct { func (x *ListRelationTuplesRequest_Query) Reset() { *x = ListRelationTuplesRequest_Query{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ListRelationTuplesRequest_Query) String() string { @@ -244,7 +238,7 @@ func (*ListRelationTuplesRequest_Query) ProtoMessage() {} func (x *ListRelationTuplesRequest_Query) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -413,44 +407,6 @@ func file_ory_keto_relation_tuples_v1alpha2_read_service_proto_init() { return } file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ListRelationTuplesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ListRelationTuplesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_read_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ListRelationTuplesRequest_Query); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/read_service_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/read_service_grpc.pb.go index 10a283cd9..ac58f6a7f 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/read_service_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/read_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/read_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( ReadService_ListRelationTuples_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.ReadService/ListRelationTuples" @@ -54,7 +54,7 @@ func (c *readServiceClient) ListRelationTuples(ctx context.Context, in *ListRela // ReadServiceServer is the server API for ReadService service. // All implementations should embed UnimplementedReadServiceServer -// for forward compatibility +// for forward compatibility. // // The service to query relationships. // @@ -64,13 +64,17 @@ type ReadServiceServer interface { ListRelationTuples(context.Context, *ListRelationTuplesRequest) (*ListRelationTuplesResponse, error) } -// UnimplementedReadServiceServer should be embedded to have forward compatible implementations. -type UnimplementedReadServiceServer struct { -} +// UnimplementedReadServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedReadServiceServer struct{} func (UnimplementedReadServiceServer) ListRelationTuples(context.Context, *ListRelationTuplesRequest) (*ListRelationTuplesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListRelationTuples not implemented") } +func (UnimplementedReadServiceServer) testEmbeddedByValue() {} // UnsafeReadServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ReadServiceServer will @@ -80,6 +84,13 @@ type UnsafeReadServiceServer interface { } func RegisterReadServiceServer(s grpc.ServiceRegistrar, srv ReadServiceServer) { + // If the following call pancis, it indicates UnimplementedReadServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&ReadService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go index ebb8612a9..8d82ba49d 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/relation_tuples.proto @@ -41,11 +41,9 @@ type RelationTuple struct { func (x *RelationTuple) Reset() { *x = RelationTuple{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RelationTuple) String() string { @@ -56,7 +54,7 @@ func (*RelationTuple) ProtoMessage() {} func (x *RelationTuple) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -129,11 +127,9 @@ type RelationQuery struct { func (x *RelationQuery) Reset() { *x = RelationQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RelationQuery) String() string { @@ -144,7 +140,7 @@ func (*RelationQuery) ProtoMessage() {} func (x *RelationQuery) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -205,11 +201,9 @@ type Subject struct { func (x *Subject) Reset() { *x = Subject{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Subject) String() string { @@ -220,7 +214,7 @@ func (*Subject) ProtoMessage() {} func (x *Subject) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -293,11 +287,9 @@ type SubjectSet struct { func (x *SubjectSet) Reset() { *x = SubjectSet{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SubjectSet) String() string { @@ -308,7 +300,7 @@ func (*SubjectSet) ProtoMessage() {} func (x *SubjectSet) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -441,56 +433,6 @@ func file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() { if File_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*RelationTuple); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*RelationQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*Subject); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*SubjectSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[1].OneofWrappers = []any{} file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_msgTypes[2].OneofWrappers = []any{ (*Subject_Id)(nil), diff --git a/proto/ory/keto/relation_tuples/v1alpha2/version.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/version.pb.go index 390766ee1..a0c5eb330 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/version.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/version.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/version.proto @@ -29,11 +29,9 @@ type GetVersionRequest struct { func (x *GetVersionRequest) Reset() { *x = GetVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetVersionRequest) String() string { @@ -44,7 +42,7 @@ func (*GetVersionRequest) ProtoMessage() {} func (x *GetVersionRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -71,11 +69,9 @@ type GetVersionResponse struct { func (x *GetVersionResponse) Reset() { *x = GetVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetVersionResponse) String() string { @@ -86,7 +82,7 @@ func (*GetVersionResponse) ProtoMessage() {} func (x *GetVersionResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -177,32 +173,6 @@ func file_ory_keto_relation_tuples_v1alpha2_version_proto_init() { if File_ory_keto_relation_tuples_v1alpha2_version_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GetVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_version_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*GetVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/version_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/version_grpc.pb.go index 5cdbde811..1dee88832 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/version_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/version_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/version.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( VersionService_GetVersion_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.VersionService/GetVersion" @@ -54,7 +54,7 @@ func (c *versionServiceClient) GetVersion(ctx context.Context, in *GetVersionReq // VersionServiceServer is the server API for VersionService service. // All implementations should embed UnimplementedVersionServiceServer -// for forward compatibility +// for forward compatibility. // // The service returning the specific Ory Keto instance version. // @@ -64,13 +64,17 @@ type VersionServiceServer interface { GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) } -// UnimplementedVersionServiceServer should be embedded to have forward compatible implementations. -type UnimplementedVersionServiceServer struct { -} +// UnimplementedVersionServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedVersionServiceServer struct{} func (UnimplementedVersionServiceServer) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") } +func (UnimplementedVersionServiceServer) testEmbeddedByValue() {} // UnsafeVersionServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to VersionServiceServer will @@ -80,6 +84,13 @@ type UnsafeVersionServiceServer interface { } func RegisterVersionServiceServer(s grpc.ServiceRegistrar, srv VersionServiceServer) { + // If the following call pancis, it indicates UnimplementedVersionServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&VersionService_ServiceDesc, srv) } diff --git a/proto/ory/keto/relation_tuples/v1alpha2/write_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/write_service.pb.go index 8fd570210..b22e8effb 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/write_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/write_service.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/write_service.proto @@ -89,11 +89,9 @@ type TransactRelationTuplesRequest struct { func (x *TransactRelationTuplesRequest) Reset() { *x = TransactRelationTuplesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactRelationTuplesRequest) String() string { @@ -104,7 +102,7 @@ func (*TransactRelationTuplesRequest) ProtoMessage() {} func (x *TransactRelationTuplesRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -140,11 +138,9 @@ type RelationTupleDelta struct { func (x *RelationTupleDelta) Reset() { *x = RelationTupleDelta{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RelationTupleDelta) String() string { @@ -155,7 +151,7 @@ func (*RelationTupleDelta) ProtoMessage() {} func (x *RelationTupleDelta) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -204,11 +200,9 @@ type TransactRelationTuplesResponse struct { func (x *TransactRelationTuplesResponse) Reset() { *x = TransactRelationTuplesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TransactRelationTuplesResponse) String() string { @@ -219,7 +213,7 @@ func (*TransactRelationTuplesResponse) ProtoMessage() {} func (x *TransactRelationTuplesResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -253,11 +247,9 @@ type DeleteRelationTuplesRequest struct { func (x *DeleteRelationTuplesRequest) Reset() { *x = DeleteRelationTuplesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeleteRelationTuplesRequest) String() string { @@ -268,7 +260,7 @@ func (*DeleteRelationTuplesRequest) ProtoMessage() {} func (x *DeleteRelationTuplesRequest) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -306,11 +298,9 @@ type DeleteRelationTuplesResponse struct { func (x *DeleteRelationTuplesResponse) Reset() { *x = DeleteRelationTuplesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeleteRelationTuplesResponse) String() string { @@ -321,7 +311,7 @@ func (*DeleteRelationTuplesResponse) ProtoMessage() {} func (x *DeleteRelationTuplesResponse) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -354,11 +344,9 @@ type DeleteRelationTuplesRequest_Query struct { func (x *DeleteRelationTuplesRequest_Query) Reset() { *x = DeleteRelationTuplesRequest_Query{} - if protoimpl.UnsafeEnabled { - mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeleteRelationTuplesRequest_Query) String() string { @@ -369,7 +357,7 @@ func (*DeleteRelationTuplesRequest_Query) ProtoMessage() {} func (x *DeleteRelationTuplesRequest_Query) ProtoReflect() protoreflect.Message { mi := &file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -566,80 +554,6 @@ func file_ory_keto_relation_tuples_v1alpha2_write_service_proto_init() { return } file_ory_keto_relation_tuples_v1alpha2_relation_tuples_proto_init() - if !protoimpl.UnsafeEnabled { - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*TransactRelationTuplesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*RelationTupleDelta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*TransactRelationTuplesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*DeleteRelationTuplesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*DeleteRelationTuplesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ory_keto_relation_tuples_v1alpha2_write_service_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*DeleteRelationTuplesRequest_Query); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/ory/keto/relation_tuples/v1alpha2/write_service_grpc.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/write_service_grpc.pb.go index 57c8f23b6..2854defe4 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/write_service_grpc.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/write_service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: ory/keto/relation_tuples/v1alpha2/write_service.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( WriteService_TransactRelationTuples_FullMethodName = "/ory.keto.relation_tuples.v1alpha2.WriteService/TransactRelationTuples" @@ -67,7 +67,7 @@ func (c *writeServiceClient) DeleteRelationTuples(ctx context.Context, in *Delet // WriteServiceServer is the server API for WriteService service. // All implementations should embed UnimplementedWriteServiceServer -// for forward compatibility +// for forward compatibility. // // The write service to create and delete Access Control Lists. // @@ -79,9 +79,12 @@ type WriteServiceServer interface { DeleteRelationTuples(context.Context, *DeleteRelationTuplesRequest) (*DeleteRelationTuplesResponse, error) } -// UnimplementedWriteServiceServer should be embedded to have forward compatible implementations. -type UnimplementedWriteServiceServer struct { -} +// UnimplementedWriteServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWriteServiceServer struct{} func (UnimplementedWriteServiceServer) TransactRelationTuples(context.Context, *TransactRelationTuplesRequest) (*TransactRelationTuplesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TransactRelationTuples not implemented") @@ -89,6 +92,7 @@ func (UnimplementedWriteServiceServer) TransactRelationTuples(context.Context, * func (UnimplementedWriteServiceServer) DeleteRelationTuples(context.Context, *DeleteRelationTuplesRequest) (*DeleteRelationTuplesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteRelationTuples not implemented") } +func (UnimplementedWriteServiceServer) testEmbeddedByValue() {} // UnsafeWriteServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to WriteServiceServer will @@ -98,6 +102,13 @@ type UnsafeWriteServiceServer interface { } func RegisterWriteServiceServer(s grpc.ServiceRegistrar, srv WriteServiceServer) { + // If the following call pancis, it indicates UnimplementedWriteServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&WriteService_ServiceDesc, srv) }