diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c6970d3 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +.PHONY: gen +gen: + protoc proto/**/*.proto -I. --go_out=pkg --go_opt=paths=source_relative --go-grpc_out=pkg --go-grpc_opt=paths=source_relative + + +.DEFAULT_GOAL := gen \ No newline at end of file diff --git a/README.md b/README.md index 0fe0c0f..3ce493d 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ git pull ## Перекомпилировать исходники ``` -protoc proto/core/error.proto proto/user/user-microservice.proto -I. --go_out=pkg --go_opt=paths=source_relative --go-grpc_out=pkg --go-grpc_opt=paths=source_relative +protoc proto/**/*.proto -I. --go_out=pkg --go_opt=paths=source_relative --go-grpc_out=pkg --go-grpc_opt=paths=source_relative ``` \ No newline at end of file diff --git a/pkg/proto/security/security-microservice.pb.go b/pkg/proto/security/security-microservice.pb.go new file mode 100644 index 0000000..5cc2c84 --- /dev/null +++ b/pkg/proto/security/security-microservice.pb.go @@ -0,0 +1,313 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: proto/security/security-microservice.proto + +package security + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Token struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` +} + +func (x *Token) Reset() { + *x = Token{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_security_security_microservice_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Token) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Token) ProtoMessage() {} + +func (x *Token) ProtoReflect() protoreflect.Message { + mi := &file_proto_security_security_microservice_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 Token.ProtoReflect.Descriptor instead. +func (*Token) Descriptor() ([]byte, []int) { + return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{0} +} + +func (x *Token) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +type LoginReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *LoginReq) Reset() { + *x = LoginReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_security_security_microservice_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginReq) ProtoMessage() {} + +func (x *LoginReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_security_security_microservice_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 LoginReq.ProtoReflect.Descriptor instead. +func (*LoginReq) Descriptor() ([]byte, []int) { + return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginReq) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +func (x *LoginReq) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type AuthCheckRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsAuth bool `protobuf:"varint,1,opt,name=is_auth,json=isAuth,proto3" json:"is_auth,omitempty"` +} + +func (x *AuthCheckRes) Reset() { + *x = AuthCheckRes{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_security_security_microservice_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthCheckRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthCheckRes) ProtoMessage() {} + +func (x *AuthCheckRes) ProtoReflect() protoreflect.Message { + mi := &file_proto_security_security_microservice_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 AuthCheckRes.ProtoReflect.Descriptor instead. +func (*AuthCheckRes) Descriptor() ([]byte, []int) { + return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{2} +} + +func (x *AuthCheckRes) GetIsAuth() bool { + if x != nil { + return x.IsAuth + } + return false +} + +var File_proto_security_security_microservice_proto protoreflect.FileDescriptor + +var file_proto_security_security_microservice_proto_rawDesc = []byte{ + 0x0a, 0x2a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2d, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, 0x0d, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x3c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, + 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, + 0x27, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x12, + 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x32, 0xaa, 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x05, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3b, 0x0a, 0x09, 0x41, 0x75, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x16, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x0f, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x0f, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x38, 0x0a, 0x06, 0x4c, 0x6f, 0x67, + 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x40, 0x0a, 0x0e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x72, 0x73, 0x2d, 0x6e, 0x65, 0x77, 0x73, 0x2f, 0x6e, 0x6f, 0x64, + 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_security_security_microservice_proto_rawDescOnce sync.Once + file_proto_security_security_microservice_proto_rawDescData = file_proto_security_security_microservice_proto_rawDesc +) + +func file_proto_security_security_microservice_proto_rawDescGZIP() []byte { + file_proto_security_security_microservice_proto_rawDescOnce.Do(func() { + file_proto_security_security_microservice_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_security_security_microservice_proto_rawDescData) + }) + return file_proto_security_security_microservice_proto_rawDescData +} + +var file_proto_security_security_microservice_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proto_security_security_microservice_proto_goTypes = []interface{}{ + (*Token)(nil), // 0: security.Token + (*LoginReq)(nil), // 1: security.LoginReq + (*AuthCheckRes)(nil), // 2: security.AuthCheckRes + (*emptypb.Empty)(nil), // 3: google.protobuf.Empty +} +var file_proto_security_security_microservice_proto_depIdxs = []int32{ + 1, // 0: security.SecurityService.Login:input_type -> security.LoginReq + 3, // 1: security.SecurityService.AuthCheck:input_type -> google.protobuf.Empty + 0, // 2: security.SecurityService.RefreshToken:input_type -> security.Token + 3, // 3: security.SecurityService.Logout:input_type -> google.protobuf.Empty + 3, // 4: security.SecurityService.HeartbeatCheck:input_type -> google.protobuf.Empty + 0, // 5: security.SecurityService.Login:output_type -> security.Token + 2, // 6: security.SecurityService.AuthCheck:output_type -> security.AuthCheckRes + 0, // 7: security.SecurityService.RefreshToken:output_type -> security.Token + 3, // 8: security.SecurityService.Logout:output_type -> google.protobuf.Empty + 3, // 9: security.SecurityService.HeartbeatCheck:output_type -> google.protobuf.Empty + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_security_security_microservice_proto_init() } +func file_proto_security_security_microservice_proto_init() { + if File_proto_security_security_microservice_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_security_security_microservice_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Token); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_security_security_microservice_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_security_security_microservice_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthCheckRes); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_security_security_microservice_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_security_security_microservice_proto_goTypes, + DependencyIndexes: file_proto_security_security_microservice_proto_depIdxs, + MessageInfos: file_proto_security_security_microservice_proto_msgTypes, + }.Build() + File_proto_security_security_microservice_proto = out.File + file_proto_security_security_microservice_proto_rawDesc = nil + file_proto_security_security_microservice_proto_goTypes = nil + file_proto_security_security_microservice_proto_depIdxs = nil +} diff --git a/pkg/proto/security/security-microservice_grpc.pb.go b/pkg/proto/security/security-microservice_grpc.pb.go new file mode 100644 index 0000000..4412392 --- /dev/null +++ b/pkg/proto/security/security-microservice_grpc.pb.go @@ -0,0 +1,246 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package security + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// 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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// SecurityServiceClient is the client API for SecurityService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SecurityServiceClient interface { + Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Token, error) + AuthCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AuthCheckRes, error) + RefreshToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Token, error) + Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + HeartbeatCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type securityServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSecurityServiceClient(cc grpc.ClientConnInterface) SecurityServiceClient { + return &securityServiceClient{cc} +} + +func (c *securityServiceClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*Token, error) { + out := new(Token) + err := c.cc.Invoke(ctx, "/security.SecurityService/Login", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *securityServiceClient) AuthCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AuthCheckRes, error) { + out := new(AuthCheckRes) + err := c.cc.Invoke(ctx, "/security.SecurityService/AuthCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *securityServiceClient) RefreshToken(ctx context.Context, in *Token, opts ...grpc.CallOption) (*Token, error) { + out := new(Token) + err := c.cc.Invoke(ctx, "/security.SecurityService/RefreshToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *securityServiceClient) Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/security.SecurityService/Logout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *securityServiceClient) HeartbeatCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/security.SecurityService/HeartbeatCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SecurityServiceServer is the server API for SecurityService service. +// All implementations must embed UnimplementedSecurityServiceServer +// for forward compatibility +type SecurityServiceServer interface { + Login(context.Context, *LoginReq) (*Token, error) + AuthCheck(context.Context, *emptypb.Empty) (*AuthCheckRes, error) + RefreshToken(context.Context, *Token) (*Token, error) + Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + mustEmbedUnimplementedSecurityServiceServer() +} + +// UnimplementedSecurityServiceServer must be embedded to have forward compatible implementations. +type UnimplementedSecurityServiceServer struct { +} + +func (UnimplementedSecurityServiceServer) Login(context.Context, *LoginReq) (*Token, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedSecurityServiceServer) AuthCheck(context.Context, *emptypb.Empty) (*AuthCheckRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthCheck not implemented") +} +func (UnimplementedSecurityServiceServer) RefreshToken(context.Context, *Token) (*Token, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") +} +func (UnimplementedSecurityServiceServer) Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} +func (UnimplementedSecurityServiceServer) HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method HeartbeatCheck not implemented") +} +func (UnimplementedSecurityServiceServer) mustEmbedUnimplementedSecurityServiceServer() {} + +// UnsafeSecurityServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SecurityServiceServer will +// result in compilation errors. +type UnsafeSecurityServiceServer interface { + mustEmbedUnimplementedSecurityServiceServer() +} + +func RegisterSecurityServiceServer(s grpc.ServiceRegistrar, srv SecurityServiceServer) { + s.RegisterService(&SecurityService_ServiceDesc, srv) +} + +func _SecurityService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SecurityServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/security.SecurityService/Login", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SecurityServiceServer).Login(ctx, req.(*LoginReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SecurityService_AuthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SecurityServiceServer).AuthCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/security.SecurityService/AuthCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SecurityServiceServer).AuthCheck(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _SecurityService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Token) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SecurityServiceServer).RefreshToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/security.SecurityService/RefreshToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SecurityServiceServer).RefreshToken(ctx, req.(*Token)) + } + return interceptor(ctx, in, info, handler) +} + +func _SecurityService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SecurityServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/security.SecurityService/Logout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SecurityServiceServer).Logout(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _SecurityService_HeartbeatCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SecurityServiceServer).HeartbeatCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/security.SecurityService/HeartbeatCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SecurityServiceServer).HeartbeatCheck(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// SecurityService_ServiceDesc is the grpc.ServiceDesc for SecurityService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SecurityService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "security.SecurityService", + HandlerType: (*SecurityServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Login", + Handler: _SecurityService_Login_Handler, + }, + { + MethodName: "AuthCheck", + Handler: _SecurityService_AuthCheck_Handler, + }, + { + MethodName: "RefreshToken", + Handler: _SecurityService_RefreshToken_Handler, + }, + { + MethodName: "Logout", + Handler: _SecurityService_Logout_Handler, + }, + { + MethodName: "HeartbeatCheck", + Handler: _SecurityService_HeartbeatCheck_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/security/security-microservice.proto", +}