diff --git a/.gitignore b/.gitignore index ddb1ae1..2d131a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node-protocol /proto -.vscode \ No newline at end of file +.vscode +/libs \ No newline at end of file diff --git a/README.md b/README.md index 3ce493d..d2bb1fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +## Установка GRPC на сервер + +``` +go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 +``` + +``` +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 +``` + +``` +export PATH="$PATH:$(go env GOPATH)/bin" +``` + ## Скачать репозиторий протоколов ``` diff --git a/go.mod b/go.mod index 8d40f5f..d33dcba 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,16 @@ module github.com/wrs-news/golang-proto go 1.18 require ( + github.com/golang/protobuf v1.5.2 google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.28.0 ) require ( - github.com/golang/protobuf v1.5.2 // indirect golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect golang.org/x/text v0.3.0 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect ) + +replace google.golang.org/genproto => ./libs/genproto diff --git a/go.sum b/go.sum index 721297c..94b30cb 100644 --- a/go.sum +++ b/go.sum @@ -53,33 +53,24 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -87,12 +78,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -110,11 +95,11 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/proto/core/error.pb.go b/pkg/proto/core/error.pb.go index 060d1ec..a4d54a4 100644 --- a/pkg/proto/core/error.pb.go +++ b/pkg/proto/core/error.pb.go @@ -1,17 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.0 +// protoc v3.12.4 // source: proto/core/error.proto package core import ( + _ "github.com/golang/protobuf/ptypes/empty" + _struct "github.com/golang/protobuf/ptypes/struct" + _ "github.com/golang/protobuf/ptypes/wrappers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" - _ "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" ) @@ -73,11 +73,11 @@ func (m *Error) GetKind() isError_Kind { return nil } -func (x *Error) GetNull() structpb.NullValue { +func (x *Error) GetNull() _struct.NullValue { if x, ok := x.GetKind().(*Error_Null); ok { return x.Null } - return structpb.NullValue_NULL_VALUE + return _struct.NullValue(0) } func (x *Error) GetError() *ErrorValue { @@ -92,7 +92,7 @@ type isError_Kind interface { } type Error_Null struct { - Null structpb.NullValue `protobuf:"varint,1,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"` + Null _struct.NullValue `protobuf:"varint,1,opt,name=null,proto3,enum=google.protobuf.NullValue,oneof"` } type Error_Error struct { @@ -331,11 +331,11 @@ func file_proto_core_error_proto_rawDescGZIP() []byte { var file_proto_core_error_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_proto_core_error_proto_goTypes = []interface{}{ - (*Error)(nil), // 0: core.Error - (*ErrorValue)(nil), // 1: core.ErrorValue - (*InternalError)(nil), // 2: core.InternalError - (*ExternalError)(nil), // 3: core.ExternalError - (structpb.NullValue)(0), // 4: google.protobuf.NullValue + (*Error)(nil), // 0: core.Error + (*ErrorValue)(nil), // 1: core.ErrorValue + (*InternalError)(nil), // 2: core.InternalError + (*ExternalError)(nil), // 3: core.ExternalError + (_struct.NullValue)(0), // 4: google.protobuf.NullValue } var file_proto_core_error_proto_depIdxs = []int32{ 4, // 0: core.Error.null:type_name -> google.protobuf.NullValue diff --git a/pkg/proto/security/security-microservice.pb.go b/pkg/proto/security/security-microservice.pb.go index 7b42258..30f3d1a 100644 --- a/pkg/proto/security/security-microservice.pb.go +++ b/pkg/proto/security/security-microservice.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.0 +// protoc v3.12.4 // source: proto/security/security-microservice.proto package security import ( + empty "github.com/golang/protobuf/ptypes/empty" 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" ) @@ -170,6 +170,53 @@ func (x *RefreshTokenReq) GetToken() string { return "" } +type LogoutReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LogoutReq) Reset() { + *x = LogoutReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_security_security_microservice_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogoutReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutReq) ProtoMessage() {} + +func (x *LogoutReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_security_security_microservice_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 LogoutReq.ProtoReflect.Descriptor instead. +func (*LogoutReq) Descriptor() ([]byte, []int) { + return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{3} +} + +func (x *LogoutReq) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + type LoginReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -182,7 +229,7 @@ type LoginReq struct { func (x *LoginReq) Reset() { *x = LoginReq{} if protoimpl.UnsafeEnabled { - mi := &file_proto_security_security_microservice_proto_msgTypes[3] + mi := &file_proto_security_security_microservice_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -195,7 +242,7 @@ func (x *LoginReq) String() string { func (*LoginReq) ProtoMessage() {} func (x *LoginReq) ProtoReflect() protoreflect.Message { - mi := &file_proto_security_security_microservice_proto_msgTypes[3] + mi := &file_proto_security_security_microservice_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -208,7 +255,7 @@ func (x *LoginReq) ProtoReflect() protoreflect.Message { // Deprecated: Use LoginReq.ProtoReflect.Descriptor instead. func (*LoginReq) Descriptor() ([]byte, []int) { - return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{3} + return file_proto_security_security_microservice_proto_rawDescGZIP(), []int{4} } func (x *LoginReq) GetLogin() string { @@ -244,25 +291,27 @@ var file_proto_security_security_microservice_proto_rawDesc = []byte{ 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x27, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 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, 0x32, 0xbe, 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 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, 0x14, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x12, 0x3b, 0x0a, 0x09, 0x41, 0x75, - 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 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, 0x3f, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 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, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x21, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 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, 0x32, 0xbb, 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 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, 0x14, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x12, 0x3b, 0x0a, + 0x09, 0x41, 0x75, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 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, 0x3f, 0x0a, 0x0c, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x50, 0x61, 0x69, 0x72, 0x12, 0x35, 0x0a, 0x06, 0x4c, + 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x13, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 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, @@ -286,25 +335,26 @@ func file_proto_security_security_microservice_proto_rawDescGZIP() []byte { return file_proto_security_security_microservice_proto_rawDescData } -var file_proto_security_security_microservice_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_proto_security_security_microservice_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_proto_security_security_microservice_proto_goTypes = []interface{}{ (*TokensPair)(nil), // 0: security.TokensPair (*AuthCheckReq)(nil), // 1: security.AuthCheckReq (*RefreshTokenReq)(nil), // 2: security.RefreshTokenReq - (*LoginReq)(nil), // 3: security.LoginReq - (*emptypb.Empty)(nil), // 4: google.protobuf.Empty + (*LogoutReq)(nil), // 3: security.LogoutReq + (*LoginReq)(nil), // 4: security.LoginReq + (*empty.Empty)(nil), // 5: google.protobuf.Empty } var file_proto_security_security_microservice_proto_depIdxs = []int32{ - 3, // 0: security.SecurityService.Login:input_type -> security.LoginReq + 4, // 0: security.SecurityService.Login:input_type -> security.LoginReq 1, // 1: security.SecurityService.AuthCheck:input_type -> security.AuthCheckReq 2, // 2: security.SecurityService.RefreshToken:input_type -> security.RefreshTokenReq - 4, // 3: security.SecurityService.Logout:input_type -> google.protobuf.Empty - 4, // 4: security.SecurityService.HeartbeatCheck:input_type -> google.protobuf.Empty + 3, // 3: security.SecurityService.Logout:input_type -> security.LogoutReq + 5, // 4: security.SecurityService.HeartbeatCheck:input_type -> google.protobuf.Empty 0, // 5: security.SecurityService.Login:output_type -> security.TokensPair - 4, // 6: security.SecurityService.AuthCheck:output_type -> google.protobuf.Empty + 5, // 6: security.SecurityService.AuthCheck:output_type -> google.protobuf.Empty 0, // 7: security.SecurityService.RefreshToken:output_type -> security.TokensPair - 4, // 8: security.SecurityService.Logout:output_type -> google.protobuf.Empty - 4, // 9: security.SecurityService.HeartbeatCheck:output_type -> google.protobuf.Empty + 5, // 8: security.SecurityService.Logout:output_type -> google.protobuf.Empty + 5, // 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 @@ -355,6 +405,18 @@ func file_proto_security_security_microservice_proto_init() { } } file_proto_security_security_microservice_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogoutReq); 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[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginReq); i { case 0: return &v.state @@ -373,7 +435,7 @@ func file_proto_security_security_microservice_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_security_security_microservice_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/proto/security/security-microservice_grpc.pb.go b/pkg/proto/security/security-microservice_grpc.pb.go index 722058a..a268f08 100644 --- a/pkg/proto/security/security-microservice_grpc.pb.go +++ b/pkg/proto/security/security-microservice_grpc.pb.go @@ -1,13 +1,17 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: proto/security/security-microservice.proto package security import ( context "context" + empty "github.com/golang/protobuf/ptypes/empty" 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 @@ -20,10 +24,10 @@ const _ = grpc.SupportPackageIsVersion7 // 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) (*TokensPair, error) - AuthCheck(ctx context.Context, in *AuthCheckReq, opts ...grpc.CallOption) (*emptypb.Empty, error) + AuthCheck(ctx context.Context, in *AuthCheckReq, opts ...grpc.CallOption) (*empty.Empty, error) RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*TokensPair, 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) + Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*empty.Empty, error) + HeartbeatCheck(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) } type securityServiceClient struct { @@ -43,8 +47,8 @@ func (c *securityServiceClient) Login(ctx context.Context, in *LoginReq, opts .. return out, nil } -func (c *securityServiceClient) AuthCheck(ctx context.Context, in *AuthCheckReq, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *securityServiceClient) AuthCheck(ctx context.Context, in *AuthCheckReq, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := c.cc.Invoke(ctx, "/security.SecurityService/AuthCheck", in, out, opts...) if err != nil { return nil, err @@ -61,8 +65,8 @@ func (c *securityServiceClient) RefreshToken(ctx context.Context, in *RefreshTok return out, nil } -func (c *securityServiceClient) Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *securityServiceClient) Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := c.cc.Invoke(ctx, "/security.SecurityService/Logout", in, out, opts...) if err != nil { return nil, err @@ -70,8 +74,8 @@ func (c *securityServiceClient) Logout(ctx context.Context, in *emptypb.Empty, o return out, nil } -func (c *securityServiceClient) HeartbeatCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *securityServiceClient) HeartbeatCheck(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := c.cc.Invoke(ctx, "/security.SecurityService/HeartbeatCheck", in, out, opts...) if err != nil { return nil, err @@ -84,10 +88,10 @@ func (c *securityServiceClient) HeartbeatCheck(ctx context.Context, in *emptypb. // for forward compatibility type SecurityServiceServer interface { Login(context.Context, *LoginReq) (*TokensPair, error) - AuthCheck(context.Context, *AuthCheckReq) (*emptypb.Empty, error) + AuthCheck(context.Context, *AuthCheckReq) (*empty.Empty, error) RefreshToken(context.Context, *RefreshTokenReq) (*TokensPair, error) - Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + Logout(context.Context, *LogoutReq) (*empty.Empty, error) + HeartbeatCheck(context.Context, *empty.Empty) (*empty.Empty, error) mustEmbedUnimplementedSecurityServiceServer() } @@ -98,16 +102,16 @@ type UnimplementedSecurityServiceServer struct { func (UnimplementedSecurityServiceServer) Login(context.Context, *LoginReq) (*TokensPair, error) { return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") } -func (UnimplementedSecurityServiceServer) AuthCheck(context.Context, *AuthCheckReq) (*emptypb.Empty, error) { +func (UnimplementedSecurityServiceServer) AuthCheck(context.Context, *AuthCheckReq) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method AuthCheck not implemented") } func (UnimplementedSecurityServiceServer) RefreshToken(context.Context, *RefreshTokenReq) (*TokensPair, error) { return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") } -func (UnimplementedSecurityServiceServer) Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { +func (UnimplementedSecurityServiceServer) Logout(context.Context, *LogoutReq) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") } -func (UnimplementedSecurityServiceServer) HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { +func (UnimplementedSecurityServiceServer) HeartbeatCheck(context.Context, *empty.Empty) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method HeartbeatCheck not implemented") } func (UnimplementedSecurityServiceServer) mustEmbedUnimplementedSecurityServiceServer() {} @@ -178,7 +182,7 @@ func _SecurityService_RefreshToken_Handler(srv interface{}, ctx context.Context, } func _SecurityService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) + in := new(LogoutReq) if err := dec(in); err != nil { return nil, err } @@ -190,13 +194,13 @@ func _SecurityService_Logout_Handler(srv interface{}, ctx context.Context, dec f FullMethod: "/security.SecurityService/Logout", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SecurityServiceServer).Logout(ctx, req.(*emptypb.Empty)) + return srv.(SecurityServiceServer).Logout(ctx, req.(*LogoutReq)) } 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) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -208,7 +212,7 @@ func _SecurityService_HeartbeatCheck_Handler(srv interface{}, ctx context.Contex FullMethod: "/security.SecurityService/HeartbeatCheck", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SecurityServiceServer).HeartbeatCheck(ctx, req.(*emptypb.Empty)) + return srv.(SecurityServiceServer).HeartbeatCheck(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) } diff --git a/pkg/proto/user/user-microservice.pb.go b/pkg/proto/user/user-microservice.pb.go index a18f347..92173df 100644 --- a/pkg/proto/user/user-microservice.pb.go +++ b/pkg/proto/user/user-microservice.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.14.0 +// protoc-gen-go v1.28.0 +// protoc v3.12.4 // source: proto/user/user-microservice.proto package user import ( + empty "github.com/golang/protobuf/ptypes/empty" 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" ) @@ -636,7 +636,7 @@ var file_proto_user_user_microservice_proto_goTypes = []interface{}{ (*SelectionReq)(nil), // 5: user.SelectionReq (*User)(nil), // 6: user.User (*Selection)(nil), // 7: user.Selection - (*emptypb.Empty)(nil), // 8: google.protobuf.Empty + (*empty.Empty)(nil), // 8: google.protobuf.Empty } var file_proto_user_user_microservice_proto_depIdxs = []int32{ 6, // 0: user.Selection.data:type_name -> user.User diff --git a/pkg/proto/user/user-microservice_grpc.pb.go b/pkg/proto/user/user-microservice_grpc.pb.go index 66f684c..a03d3d5 100644 --- a/pkg/proto/user/user-microservice_grpc.pb.go +++ b/pkg/proto/user/user-microservice_grpc.pb.go @@ -1,13 +1,17 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: proto/user/user-microservice.proto package user import ( context "context" + empty "github.com/golang/protobuf/ptypes/empty" 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 @@ -26,7 +30,7 @@ type UserServiceClient interface { DeleteUser(ctx context.Context, in *UserReqUuid, opts ...grpc.CallOption) (*User, error) UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*User, error) GetAll(ctx context.Context, in *SelectionReq, opts ...grpc.CallOption) (*Selection, error) - HeartbeatCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + HeartbeatCheck(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) } type userServiceClient struct { @@ -100,8 +104,8 @@ func (c *userServiceClient) GetAll(ctx context.Context, in *SelectionReq, opts . return out, nil } -func (c *userServiceClient) HeartbeatCheck(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) +func (c *userServiceClient) HeartbeatCheck(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) err := c.cc.Invoke(ctx, "/user.UserService/HeartbeatCheck", in, out, opts...) if err != nil { return nil, err @@ -120,7 +124,7 @@ type UserServiceServer interface { DeleteUser(context.Context, *UserReqUuid) (*User, error) UpdateUser(context.Context, *UpdateUserReq) (*User, error) GetAll(context.Context, *SelectionReq) (*Selection, error) - HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + HeartbeatCheck(context.Context, *empty.Empty) (*empty.Empty, error) mustEmbedUnimplementedUserServiceServer() } @@ -149,7 +153,7 @@ func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserReq func (UnimplementedUserServiceServer) GetAll(context.Context, *SelectionReq) (*Selection, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") } -func (UnimplementedUserServiceServer) HeartbeatCheck(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { +func (UnimplementedUserServiceServer) HeartbeatCheck(context.Context, *empty.Empty) (*empty.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method HeartbeatCheck not implemented") } func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} @@ -292,7 +296,7 @@ func _UserService_GetAll_Handler(srv interface{}, ctx context.Context, dec func( } func _UserService_HeartbeatCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) + in := new(empty.Empty) if err := dec(in); err != nil { return nil, err } @@ -304,7 +308,7 @@ func _UserService_HeartbeatCheck_Handler(srv interface{}, ctx context.Context, d FullMethod: "/user.UserService/HeartbeatCheck", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).HeartbeatCheck(ctx, req.(*emptypb.Empty)) + return srv.(UserServiceServer).HeartbeatCheck(ctx, req.(*empty.Empty)) } return interceptor(ctx, in, info, handler) }