diff --git a/gen/go/search/search.pb.go b/gen/go/search/search.pb.go new file mode 100644 index 0000000..78a7a4d --- /dev/null +++ b/gen/go/search/search.pb.go @@ -0,0 +1,297 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: search/search.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 SearchUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Status *string `protobuf:"bytes,4,opt,name=status,proto3,oneof" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + mi := &file_search_search_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_search_search_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_search_search_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchUsersRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchUsersRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *SearchUsersRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SearchUsersRequest) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +type SearchUserItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + IsPublic bool `protobuf:"varint,6,opt,name=is_public,json=isPublic,proto3" json:"is_public,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUserItem) Reset() { + *x = SearchUserItem{} + mi := &file_search_search_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUserItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUserItem) ProtoMessage() {} + +func (x *SearchUserItem) ProtoReflect() protoreflect.Message { + mi := &file_search_search_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUserItem.ProtoReflect.Descriptor instead. +func (*SearchUserItem) Descriptor() ([]byte, []int) { + return file_search_search_proto_rawDescGZIP(), []int{1} +} + +func (x *SearchUserItem) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SearchUserItem) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SearchUserItem) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *SearchUserItem) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *SearchUserItem) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *SearchUserItem) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +type SearchUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*SearchUserItem `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + mi := &file_search_search_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_search_search_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_search_search_proto_rawDescGZIP(), []int{2} +} + +func (x *SearchUsersResponse) GetUsers() []*SearchUserItem { + if x != nil { + return x.Users + } + return nil +} + +var File_search_search_proto protoreflect.FileDescriptor + +const file_search_search_proto_rawDesc = "" + + "\n" + + "\x13search/search.proto\x12\tsearch.v1\"\x8a\x01\n" + + "\x12SearchUsersRequest\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x03 \x01(\tR\tsessionId\x12\x1b\n" + + "\x06status\x18\x04 \x01(\tH\x00R\x06status\x88\x01\x01B\t\n" + + "\a_status\"\xad\x01\n" + + "\x0eSearchUserItem\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x1b\n" + + "\tfull_name\x18\x03 \x01(\tR\bfullName\x12\x1d\n" + + "\n" + + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12\x16\n" + + "\x06status\x18\x05 \x01(\tR\x06status\x12\x1b\n" + + "\tis_public\x18\x06 \x01(\bR\bisPublic\"F\n" + + "\x13SearchUsersResponse\x12/\n" + + "\x05users\x18\x01 \x03(\v2\x19.search.v1.SearchUserItemR\x05users2]\n" + + "\rSearchService\x12L\n" + + "\vSearchUsers\x12\x1d.search.v1.SearchUsersRequest\x1a\x1e.search.v1.SearchUsersResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_search_search_proto_rawDescOnce sync.Once + file_search_search_proto_rawDescData []byte +) + +func file_search_search_proto_rawDescGZIP() []byte { + file_search_search_proto_rawDescOnce.Do(func() { + file_search_search_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_search_search_proto_rawDesc), len(file_search_search_proto_rawDesc))) + }) + return file_search_search_proto_rawDescData +} + +var file_search_search_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_search_search_proto_goTypes = []any{ + (*SearchUsersRequest)(nil), // 0: search.v1.SearchUsersRequest + (*SearchUserItem)(nil), // 1: search.v1.SearchUserItem + (*SearchUsersResponse)(nil), // 2: search.v1.SearchUsersResponse +} +var file_search_search_proto_depIdxs = []int32{ + 1, // 0: search.v1.SearchUsersResponse.users:type_name -> search.v1.SearchUserItem + 0, // 1: search.v1.SearchService.SearchUsers:input_type -> search.v1.SearchUsersRequest + 2, // 2: search.v1.SearchService.SearchUsers:output_type -> search.v1.SearchUsersResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_search_search_proto_init() } +func file_search_search_proto_init() { + if File_search_search_proto != nil { + return + } + file_search_search_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_search_search_proto_rawDesc), len(file_search_search_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_search_search_proto_goTypes, + DependencyIndexes: file_search_search_proto_depIdxs, + MessageInfos: file_search_search_proto_msgTypes, + }.Build() + File_search_search_proto = out.File + file_search_search_proto_goTypes = nil + file_search_search_proto_depIdxs = nil +} diff --git a/gen/go/search/search_grpc.pb.go b/gen/go/search/search_grpc.pb.go new file mode 100644 index 0000000..34f0bed --- /dev/null +++ b/gen/go/search/search_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: search/search.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + SearchService_SearchUsers_FullMethodName = "/search.v1.SearchService/SearchUsers" +) + +// SearchServiceClient is the client API for SearchService 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 SearchServiceClient interface { + SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) +} + +type searchServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSearchServiceClient(cc grpc.ClientConnInterface) SearchServiceClient { + return &searchServiceClient{cc} +} + +func (c *searchServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SearchUsersResponse) + err := c.cc.Invoke(ctx, SearchService_SearchUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SearchServiceServer is the server API for SearchService service. +// All implementations must embed UnimplementedSearchServiceServer +// for forward compatibility. +type SearchServiceServer interface { + SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) + mustEmbedUnimplementedSearchServiceServer() +} + +// UnimplementedSearchServiceServer must 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 UnimplementedSearchServiceServer struct{} + +func (UnimplementedSearchServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SearchUsers not implemented") +} +func (UnimplementedSearchServiceServer) mustEmbedUnimplementedSearchServiceServer() {} +func (UnimplementedSearchServiceServer) testEmbeddedByValue() {} + +// UnsafeSearchServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SearchServiceServer will +// result in compilation errors. +type UnsafeSearchServiceServer interface { + mustEmbedUnimplementedSearchServiceServer() +} + +func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer) { + // If the following call panics, it indicates UnimplementedSearchServiceServer 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(&SearchService_ServiceDesc, srv) +} + +func _SearchService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SearchServiceServer).SearchUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SearchService_SearchUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SearchServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SearchService_ServiceDesc is the grpc.ServiceDesc for SearchService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SearchService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "search.v1.SearchService", + HandlerType: (*SearchServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SearchUsers", + Handler: _SearchService_SearchUsers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "search/search.proto", +} diff --git a/gen/go/sso/account.pb.go b/gen/go/sso/account.pb.go new file mode 100644 index 0000000..1ef3a00 --- /dev/null +++ b/gen/go/sso/account.pb.go @@ -0,0 +1,2255 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/account.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 GetAccountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountRequest) Reset() { + *x = GetAccountRequest{} + mi := &file_sso_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountRequest) ProtoMessage() {} + +func (x *GetAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountRequest.ProtoReflect.Descriptor instead. +func (*GetAccountRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAccountRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetAccountResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` + FullName string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + IsLdap bool `protobuf:"varint,6,opt,name=is_ldap,json=isLdap,proto3" json:"is_ldap,omitempty"` + Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` + Roles []string `protobuf:"bytes,8,rep,name=roles,proto3" json:"roles,omitempty"` + AvatarUrl string `protobuf:"bytes,9,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + EmployeeId *string `protobuf:"bytes,10,opt,name=employee_id,json=employeeId,proto3,oneof" json:"employee_id,omitempty"` + Presence string `protobuf:"bytes,11,opt,name=presence,proto3" json:"presence,omitempty"` + LastActive string `protobuf:"bytes,12,opt,name=last_active,json=lastActive,proto3" json:"last_active,omitempty"` + CustomStatusText string `protobuf:"bytes,13,opt,name=custom_status_text,json=customStatusText,proto3" json:"custom_status_text,omitempty"` + CustomStatusEmoji string `protobuf:"bytes,14,opt,name=custom_status_emoji,json=customStatusEmoji,proto3" json:"custom_status_emoji,omitempty"` + Timezone string `protobuf:"bytes,15,opt,name=timezone,proto3" json:"timezone,omitempty"` + Language string `protobuf:"bytes,16,opt,name=language,proto3" json:"language,omitempty"` + TwoFaEnabled bool `protobuf:"varint,17,opt,name=two_fa_enabled,json=twoFaEnabled,proto3" json:"two_fa_enabled,omitempty"` + HasPin bool `protobuf:"varint,18,opt,name=has_pin,json=hasPin,proto3" json:"has_pin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountResponse) Reset() { + *x = GetAccountResponse{} + mi := &file_sso_account_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountResponse) ProtoMessage() {} + +func (x *GetAccountResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountResponse.ProtoReflect.Descriptor instead. +func (*GetAccountResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAccountResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAccountResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetAccountResponse) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetAccountResponse) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *GetAccountResponse) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *GetAccountResponse) GetIsLdap() bool { + if x != nil { + return x.IsLdap + } + return false +} + +func (x *GetAccountResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *GetAccountResponse) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +func (x *GetAccountResponse) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *GetAccountResponse) GetEmployeeId() string { + if x != nil && x.EmployeeId != nil { + return *x.EmployeeId + } + return "" +} + +func (x *GetAccountResponse) GetPresence() string { + if x != nil { + return x.Presence + } + return "" +} + +func (x *GetAccountResponse) GetLastActive() string { + if x != nil { + return x.LastActive + } + return "" +} + +func (x *GetAccountResponse) GetCustomStatusText() string { + if x != nil { + return x.CustomStatusText + } + return "" +} + +func (x *GetAccountResponse) GetCustomStatusEmoji() string { + if x != nil { + return x.CustomStatusEmoji + } + return "" +} + +func (x *GetAccountResponse) GetTimezone() string { + if x != nil { + return x.Timezone + } + return "" +} + +func (x *GetAccountResponse) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +func (x *GetAccountResponse) GetTwoFaEnabled() bool { + if x != nil { + return x.TwoFaEnabled + } + return false +} + +func (x *GetAccountResponse) GetHasPin() bool { + if x != nil { + return x.HasPin + } + return false +} + +type ChangePasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OldPassword string `protobuf:"bytes,3,opt,name=old_password,json=oldPassword,proto3" json:"old_password,omitempty"` + NewPassword string `protobuf:"bytes,4,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` + Code *string `protobuf:"bytes,5,opt,name=code,proto3,oneof" json:"code,omitempty"` + SessionId string `protobuf:"bytes,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangePasswordRequest) Reset() { + *x = ChangePasswordRequest{} + mi := &file_sso_account_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangePasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangePasswordRequest) ProtoMessage() {} + +func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. +func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{2} +} + +func (x *ChangePasswordRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ChangePasswordRequest) GetOldPassword() string { + if x != nil { + return x.OldPassword + } + return "" +} + +func (x *ChangePasswordRequest) GetNewPassword() string { + if x != nil { + return x.NewPassword + } + return "" +} + +func (x *ChangePasswordRequest) GetCode() string { + if x != nil && x.Code != nil { + return *x.Code + } + return "" +} + +func (x *ChangePasswordRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type ChangePasswordResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangePasswordResponse) Reset() { + *x = ChangePasswordResponse{} + mi := &file_sso_account_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangePasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangePasswordResponse) ProtoMessage() {} + +func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead. +func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{3} +} + +func (x *ChangePasswordResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ChangePasswordResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type CreateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + mi := &file_sso_account_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CreateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *CreateUserRequest) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +type CreateUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserResponse) Reset() { + *x = CreateUserResponse{} + mi := &file_sso_account_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserResponse) ProtoMessage() {} + +func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. +func (*CreateUserResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *CreateUserResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeleteUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + mi := &file_sso_account_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type DeleteUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteUserResponse) Reset() { + *x = DeleteUserResponse{} + mi := &file_sso_account_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserResponse) ProtoMessage() {} + +func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. +func (*DeleteUserResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeleteUserResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ChangeDataRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` + Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"` + FullName *string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"` + AvatarUrl *string `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"` + CustomStatusText *string `protobuf:"bytes,7,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"` + CustomStatusEmoji *string `protobuf:"bytes,8,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"` + Timezone *string `protobuf:"bytes,9,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"` + Language *string `protobuf:"bytes,10,opt,name=language,proto3,oneof" json:"language,omitempty"` + IsPublic *bool `protobuf:"varint,11,opt,name=is_public,json=isPublic,proto3,oneof" json:"is_public,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangeDataRequest) Reset() { + *x = ChangeDataRequest{} + mi := &file_sso_account_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangeDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeDataRequest) ProtoMessage() {} + +func (x *ChangeDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeDataRequest.ProtoReflect.Descriptor instead. +func (*ChangeDataRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{8} +} + +func (x *ChangeDataRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ChangeDataRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *ChangeDataRequest) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *ChangeDataRequest) GetPhone() string { + if x != nil && x.Phone != nil { + return *x.Phone + } + return "" +} + +func (x *ChangeDataRequest) GetFullName() string { + if x != nil && x.FullName != nil { + return *x.FullName + } + return "" +} + +func (x *ChangeDataRequest) GetAvatarUrl() string { + if x != nil && x.AvatarUrl != nil { + return *x.AvatarUrl + } + return "" +} + +func (x *ChangeDataRequest) GetCustomStatusText() string { + if x != nil && x.CustomStatusText != nil { + return *x.CustomStatusText + } + return "" +} + +func (x *ChangeDataRequest) GetCustomStatusEmoji() string { + if x != nil && x.CustomStatusEmoji != nil { + return *x.CustomStatusEmoji + } + return "" +} + +func (x *ChangeDataRequest) GetTimezone() string { + if x != nil && x.Timezone != nil { + return *x.Timezone + } + return "" +} + +func (x *ChangeDataRequest) GetLanguage() string { + if x != nil && x.Language != nil { + return *x.Language + } + return "" +} + +func (x *ChangeDataRequest) GetIsPublic() bool { + if x != nil && x.IsPublic != nil { + return *x.IsPublic + } + return false +} + +type ChangeDataResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangeDataResponse) Reset() { + *x = ChangeDataResponse{} + mi := &file_sso_account_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangeDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeDataResponse) ProtoMessage() {} + +func (x *ChangeDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeDataResponse.ProtoReflect.Descriptor instead. +func (*ChangeDataResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{9} +} + +func (x *ChangeDataResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ChangeDataResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type AssignRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` // В gRPC передаем как string, внутри преобразуем в Int + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AssignRoleRequest) Reset() { + *x = AssignRoleRequest{} + mi := &file_sso_account_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AssignRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssignRoleRequest) ProtoMessage() {} + +func (x *AssignRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssignRoleRequest.ProtoReflect.Descriptor instead. +func (*AssignRoleRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{10} +} + +func (x *AssignRoleRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AssignRoleRequest) GetRoleId() string { + if x != nil { + return x.RoleId + } + return "" +} + +type AssignRoleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AssignRoleResponse) Reset() { + *x = AssignRoleResponse{} + mi := &file_sso_account_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AssignRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssignRoleResponse) ProtoMessage() {} + +func (x *AssignRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AssignRoleResponse.ProtoReflect.Descriptor instead. +func (*AssignRoleResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{11} +} + +func (x *AssignRoleResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *AssignRoleResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type RevokeRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RoleId string `protobuf:"bytes,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RevokeRoleRequest) Reset() { + *x = RevokeRoleRequest{} + mi := &file_sso_account_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RevokeRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeRoleRequest) ProtoMessage() {} + +func (x *RevokeRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeRoleRequest.ProtoReflect.Descriptor instead. +func (*RevokeRoleRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{12} +} + +func (x *RevokeRoleRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *RevokeRoleRequest) GetRoleId() string { + if x != nil { + return x.RoleId + } + return "" +} + +type RevokeRoleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RevokeRoleResponse) Reset() { + *x = RevokeRoleResponse{} + mi := &file_sso_account_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RevokeRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RevokeRoleResponse) ProtoMessage() {} + +func (x *RevokeRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RevokeRoleResponse.ProtoReflect.Descriptor instead. +func (*RevokeRoleResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{13} +} + +func (x *RevokeRoleResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RevokeRoleResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type AdminResetPasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + NewPassword string `protobuf:"bytes,2,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminResetPasswordRequest) Reset() { + *x = AdminResetPasswordRequest{} + mi := &file_sso_account_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminResetPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminResetPasswordRequest) ProtoMessage() {} + +func (x *AdminResetPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminResetPasswordRequest.ProtoReflect.Descriptor instead. +func (*AdminResetPasswordRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{14} +} + +func (x *AdminResetPasswordRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AdminResetPasswordRequest) GetNewPassword() string { + if x != nil { + return x.NewPassword + } + return "" +} + +type AdminResetPasswordResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AdminResetPasswordResponse) Reset() { + *x = AdminResetPasswordResponse{} + mi := &file_sso_account_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdminResetPasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminResetPasswordResponse) ProtoMessage() {} + +func (x *AdminResetPasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminResetPasswordResponse.ProtoReflect.Descriptor instead. +func (*AdminResetPasswordResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{15} +} + +func (x *AdminResetPasswordResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *AdminResetPasswordResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type SetPinRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Pin string `protobuf:"bytes,3,opt,name=pin,proto3" json:"pin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetPinRequest) Reset() { + *x = SetPinRequest{} + mi := &file_sso_account_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetPinRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPinRequest) ProtoMessage() {} + +func (x *SetPinRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPinRequest.ProtoReflect.Descriptor instead. +func (*SetPinRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{16} +} + +func (x *SetPinRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *SetPinRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *SetPinRequest) GetPin() string { + if x != nil { + return x.Pin + } + return "" +} + +type SetPinResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SetPinResponse) Reset() { + *x = SetPinResponse{} + mi := &file_sso_account_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetPinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetPinResponse) ProtoMessage() {} + +func (x *SetPinResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetPinResponse.ProtoReflect.Descriptor instead. +func (*SetPinResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{17} +} + +func (x *SetPinResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *SetPinResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type UnlockPinRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Pin string `protobuf:"bytes,3,opt,name=pin,proto3" json:"pin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnlockPinRequest) Reset() { + *x = UnlockPinRequest{} + mi := &file_sso_account_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnlockPinRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnlockPinRequest) ProtoMessage() {} + +func (x *UnlockPinRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnlockPinRequest.ProtoReflect.Descriptor instead. +func (*UnlockPinRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{18} +} + +func (x *UnlockPinRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UnlockPinRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *UnlockPinRequest) GetPin() string { + if x != nil { + return x.Pin + } + return "" +} + +type UnlockPinResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnlockPinResponse) Reset() { + *x = UnlockPinResponse{} + mi := &file_sso_account_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnlockPinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnlockPinResponse) ProtoMessage() {} + +func (x *UnlockPinResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnlockPinResponse.ProtoReflect.Descriptor instead. +func (*UnlockPinResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{19} +} + +func (x *UnlockPinResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UnlockPinResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type GetPinStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPinStatusRequest) Reset() { + *x = GetPinStatusRequest{} + mi := &file_sso_account_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPinStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPinStatusRequest) ProtoMessage() {} + +func (x *GetPinStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPinStatusRequest.ProtoReflect.Descriptor instead. +func (*GetPinStatusRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{20} +} + +func (x *GetPinStatusRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetPinStatusRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type GetPinStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + HasPin bool `protobuf:"varint,1,opt,name=has_pin,json=hasPin,proto3" json:"has_pin,omitempty"` + IsLocked bool `protobuf:"varint,2,opt,name=is_locked,json=isLocked,proto3" json:"is_locked,omitempty"` + LockUntil string `protobuf:"bytes,3,opt,name=lock_until,json=lockUntil,proto3" json:"lock_until,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPinStatusResponse) Reset() { + *x = GetPinStatusResponse{} + mi := &file_sso_account_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPinStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPinStatusResponse) ProtoMessage() {} + +func (x *GetPinStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPinStatusResponse.ProtoReflect.Descriptor instead. +func (*GetPinStatusResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{21} +} + +func (x *GetPinStatusResponse) GetHasPin() bool { + if x != nil { + return x.HasPin + } + return false +} + +func (x *GetPinStatusResponse) GetIsLocked() bool { + if x != nil { + return x.IsLocked + } + return false +} + +func (x *GetPinStatusResponse) GetLockUntil() string { + if x != nil { + return x.LockUntil + } + return "" +} + +type RemovePinRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Pin string `protobuf:"bytes,1,opt,name=pin,proto3" json:"pin,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemovePinRequest) Reset() { + *x = RemovePinRequest{} + mi := &file_sso_account_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemovePinRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemovePinRequest) ProtoMessage() {} + +func (x *RemovePinRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemovePinRequest.ProtoReflect.Descriptor instead. +func (*RemovePinRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{22} +} + +func (x *RemovePinRequest) GetPin() string { + if x != nil { + return x.Pin + } + return "" +} + +func (x *RemovePinRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *RemovePinRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type RemovePinResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemovePinResponse) Reset() { + *x = RemovePinResponse{} + mi := &file_sso_account_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemovePinResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemovePinResponse) ProtoMessage() {} + +func (x *RemovePinResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemovePinResponse.ProtoReflect.Descriptor instead. +func (*RemovePinResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{23} +} + +func (x *RemovePinResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *RemovePinResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type BlockUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Кого блокируем + AdminId string `protobuf:"bytes,2,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` // Кто блокирует + Reason *string `protobuf:"bytes,3,opt,name=reason,proto3,oneof" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockUserRequest) Reset() { + *x = BlockUserRequest{} + mi := &file_sso_account_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockUserRequest) ProtoMessage() {} + +func (x *BlockUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockUserRequest.ProtoReflect.Descriptor instead. +func (*BlockUserRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{24} +} + +func (x *BlockUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *BlockUserRequest) GetAdminId() string { + if x != nil { + return x.AdminId + } + return "" +} + +func (x *BlockUserRequest) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +type BlockUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockUserResponse) Reset() { + *x = BlockUserResponse{} + mi := &file_sso_account_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockUserResponse) ProtoMessage() {} + +func (x *BlockUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockUserResponse.ProtoReflect.Descriptor instead. +func (*BlockUserResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{25} +} + +func (x *BlockUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *BlockUserResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type UnblockUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + AdminId string `protobuf:"bytes,2,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockUserRequest) Reset() { + *x = UnblockUserRequest{} + mi := &file_sso_account_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockUserRequest) ProtoMessage() {} + +func (x *UnblockUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockUserRequest.ProtoReflect.Descriptor instead. +func (*UnblockUserRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{26} +} + +func (x *UnblockUserRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UnblockUserRequest) GetAdminId() string { + if x != nil { + return x.AdminId + } + return "" +} + +type UnblockUserResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockUserResponse) Reset() { + *x = UnblockUserResponse{} + mi := &file_sso_account_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockUserResponse) ProtoMessage() {} + +func (x *UnblockUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockUserResponse.ProtoReflect.Descriptor instead. +func (*UnblockUserResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{27} +} + +func (x *UnblockUserResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UnblockUserResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type BlockIpRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + IpAddress string `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + AdminId string `protobuf:"bytes,2,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` + Reason *string `protobuf:"bytes,3,opt,name=reason,proto3,oneof" json:"reason,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockIpRequest) Reset() { + *x = BlockIpRequest{} + mi := &file_sso_account_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockIpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockIpRequest) ProtoMessage() {} + +func (x *BlockIpRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockIpRequest.ProtoReflect.Descriptor instead. +func (*BlockIpRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{28} +} + +func (x *BlockIpRequest) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +func (x *BlockIpRequest) GetAdminId() string { + if x != nil { + return x.AdminId + } + return "" +} + +func (x *BlockIpRequest) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +type BlockIpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockIpResponse) Reset() { + *x = BlockIpResponse{} + mi := &file_sso_account_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockIpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockIpResponse) ProtoMessage() {} + +func (x *BlockIpResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockIpResponse.ProtoReflect.Descriptor instead. +func (*BlockIpResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{29} +} + +func (x *BlockIpResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *BlockIpResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type UnblockIpRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + IpAddress string `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + AdminId string `protobuf:"bytes,2,opt,name=admin_id,json=adminId,proto3" json:"admin_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockIpRequest) Reset() { + *x = UnblockIpRequest{} + mi := &file_sso_account_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockIpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockIpRequest) ProtoMessage() {} + +func (x *UnblockIpRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockIpRequest.ProtoReflect.Descriptor instead. +func (*UnblockIpRequest) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{30} +} + +func (x *UnblockIpRequest) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +func (x *UnblockIpRequest) GetAdminId() string { + if x != nil { + return x.AdminId + } + return "" +} + +type UnblockIpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockIpResponse) Reset() { + *x = UnblockIpResponse{} + mi := &file_sso_account_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockIpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockIpResponse) ProtoMessage() {} + +func (x *UnblockIpResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_account_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockIpResponse.ProtoReflect.Descriptor instead. +func (*UnblockIpResponse) Descriptor() ([]byte, []int) { + return file_sso_account_proto_rawDescGZIP(), []int{31} +} + +func (x *UnblockIpResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UnblockIpResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_sso_account_proto protoreflect.FileDescriptor + +const file_sso_account_proto_rawDesc = "" + + "\n" + + "\x11sso/account.proto\x12\n" + + "account.v1\"#\n" + + "\x11GetAccountRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\xb7\x04\n" + + "\x12GetAccountResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\x12\x14\n" + + "\x05phone\x18\x04 \x01(\tR\x05phone\x12\x1b\n" + + "\tfull_name\x18\x05 \x01(\tR\bfullName\x12\x17\n" + + "\ais_ldap\x18\x06 \x01(\bR\x06isLdap\x12\x16\n" + + "\x06status\x18\a \x01(\tR\x06status\x12\x14\n" + + "\x05roles\x18\b \x03(\tR\x05roles\x12\x1d\n" + + "\n" + + "avatar_url\x18\t \x01(\tR\tavatarUrl\x12$\n" + + "\vemployee_id\x18\n" + + " \x01(\tH\x00R\n" + + "employeeId\x88\x01\x01\x12\x1a\n" + + "\bpresence\x18\v \x01(\tR\bpresence\x12\x1f\n" + + "\vlast_active\x18\f \x01(\tR\n" + + "lastActive\x12,\n" + + "\x12custom_status_text\x18\r \x01(\tR\x10customStatusText\x12.\n" + + "\x13custom_status_emoji\x18\x0e \x01(\tR\x11customStatusEmoji\x12\x1a\n" + + "\btimezone\x18\x0f \x01(\tR\btimezone\x12\x1a\n" + + "\blanguage\x18\x10 \x01(\tR\blanguage\x12$\n" + + "\x0etwo_fa_enabled\x18\x11 \x01(\bR\ftwoFaEnabled\x12\x17\n" + + "\ahas_pin\x18\x12 \x01(\bR\x06hasPinB\x0e\n" + + "\f_employee_id\"\xb7\x01\n" + + "\x15ChangePasswordRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12!\n" + + "\fold_password\x18\x03 \x01(\tR\voldPassword\x12!\n" + + "\fnew_password\x18\x04 \x01(\tR\vnewPassword\x12\x17\n" + + "\x04code\x18\x05 \x01(\tH\x00R\x04code\x88\x01\x01\x12\x1d\n" + + "\n" + + "session_id\x18\x06 \x01(\tR\tsessionIdB\a\n" + + "\x05_code\"L\n" + + "\x16ChangePasswordResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"a\n" + + "\x11CreateUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x14\n" + + "\x05roles\x18\x03 \x03(\tR\x05roles\"H\n" + + "\x12CreateUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\",\n" + + "\x11DeleteUserRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"H\n" + + "\x12DeleteUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\x9b\x04\n" + + "\x11ChangeDataRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x19\n" + + "\x05email\x18\x03 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" + + "\x05phone\x18\x04 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" + + "\tfull_name\x18\x05 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\"\n" + + "\n" + + "avatar_url\x18\x06 \x01(\tH\x03R\tavatarUrl\x88\x01\x01\x121\n" + + "\x12custom_status_text\x18\a \x01(\tH\x04R\x10customStatusText\x88\x01\x01\x123\n" + + "\x13custom_status_emoji\x18\b \x01(\tH\x05R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" + + "\btimezone\x18\t \x01(\tH\x06R\btimezone\x88\x01\x01\x12\x1f\n" + + "\blanguage\x18\n" + + " \x01(\tH\aR\blanguage\x88\x01\x01\x12 \n" + + "\tis_public\x18\v \x01(\bH\bR\bisPublic\x88\x01\x01B\b\n" + + "\x06_emailB\b\n" + + "\x06_phoneB\f\n" + + "\n" + + "_full_nameB\r\n" + + "\v_avatar_urlB\x15\n" + + "\x13_custom_status_textB\x16\n" + + "\x14_custom_status_emojiB\v\n" + + "\t_timezoneB\v\n" + + "\t_languageB\f\n" + + "\n" + + "_is_public\"H\n" + + "\x12ChangeDataResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"E\n" + + "\x11AssignRoleRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + + "\arole_id\x18\x02 \x01(\tR\x06roleId\"H\n" + + "\x12AssignRoleResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"E\n" + + "\x11RevokeRoleRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" + + "\arole_id\x18\x02 \x01(\tR\x06roleId\"H\n" + + "\x12RevokeRoleResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"W\n" + + "\x19AdminResetPasswordRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12!\n" + + "\fnew_password\x18\x02 \x01(\tR\vnewPassword\"P\n" + + "\x1aAdminResetPasswordResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"Y\n" + + "\rSetPinRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x10\n" + + "\x03pin\x18\x03 \x01(\tR\x03pin\"D\n" + + "\x0eSetPinResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\\\n" + + "\x10UnlockPinRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\x12\x10\n" + + "\x03pin\x18\x03 \x01(\tR\x03pin\"G\n" + + "\x11UnlockPinResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"M\n" + + "\x13GetPinStatusRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"k\n" + + "\x14GetPinStatusResponse\x12\x17\n" + + "\ahas_pin\x18\x01 \x01(\bR\x06hasPin\x12\x1b\n" + + "\tis_locked\x18\x02 \x01(\bR\bisLocked\x12\x1d\n" + + "\n" + + "lock_until\x18\x03 \x01(\tR\tlockUntil\"\\\n" + + "\x10RemovePinRequest\x12\x10\n" + + "\x03pin\x18\x01 \x01(\tR\x03pin\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x03 \x01(\tR\tsessionId\"G\n" + + "\x11RemovePinResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"n\n" + + "\x10BlockUserRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x19\n" + + "\badmin_id\x18\x02 \x01(\tR\aadminId\x12\x1b\n" + + "\x06reason\x18\x03 \x01(\tH\x00R\x06reason\x88\x01\x01B\t\n" + + "\a_reason\"G\n" + + "\x11BlockUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"H\n" + + "\x12UnblockUserRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x19\n" + + "\badmin_id\x18\x02 \x01(\tR\aadminId\"I\n" + + "\x13UnblockUserResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"r\n" + + "\x0eBlockIpRequest\x12\x1d\n" + + "\n" + + "ip_address\x18\x01 \x01(\tR\tipAddress\x12\x19\n" + + "\badmin_id\x18\x02 \x01(\tR\aadminId\x12\x1b\n" + + "\x06reason\x18\x03 \x01(\tH\x00R\x06reason\x88\x01\x01B\t\n" + + "\a_reason\"E\n" + + "\x0fBlockIpResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"L\n" + + "\x10UnblockIpRequest\x12\x1d\n" + + "\n" + + "ip_address\x18\x01 \x01(\tR\tipAddress\x12\x19\n" + + "\badmin_id\x18\x02 \x01(\tR\aadminId\"G\n" + + "\x11UnblockIpResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage2\xec\t\n" + + "\x0eAccountService\x12K\n" + + "\n" + + "GetAccount\x12\x1d.account.v1.GetAccountRequest\x1a\x1e.account.v1.GetAccountResponse\x12W\n" + + "\x0eChangePassword\x12!.account.v1.ChangePasswordRequest\x1a\".account.v1.ChangePasswordResponse\x12c\n" + + "\x12AdminResetPassword\x12%.account.v1.AdminResetPasswordRequest\x1a&.account.v1.AdminResetPasswordResponse\x12K\n" + + "\n" + + "CreateUser\x12\x1d.account.v1.CreateUserRequest\x1a\x1e.account.v1.CreateUserResponse\x12K\n" + + "\n" + + "DeleteUser\x12\x1d.account.v1.DeleteUserRequest\x1a\x1e.account.v1.DeleteUserResponse\x12K\n" + + "\n" + + "ChangeData\x12\x1d.account.v1.ChangeDataRequest\x1a\x1e.account.v1.ChangeDataResponse\x12K\n" + + "\n" + + "AssignRole\x12\x1d.account.v1.AssignRoleRequest\x1a\x1e.account.v1.AssignRoleResponse\x12K\n" + + "\n" + + "RevokeRole\x12\x1d.account.v1.RevokeRoleRequest\x1a\x1e.account.v1.RevokeRoleResponse\x12?\n" + + "\x06SetPin\x12\x19.account.v1.SetPinRequest\x1a\x1a.account.v1.SetPinResponse\x12H\n" + + "\tUnlockPin\x12\x1c.account.v1.UnlockPinRequest\x1a\x1d.account.v1.UnlockPinResponse\x12Q\n" + + "\fGetPinStatus\x12\x1f.account.v1.GetPinStatusRequest\x1a .account.v1.GetPinStatusResponse\x12H\n" + + "\tRemovePin\x12\x1c.account.v1.RemovePinRequest\x1a\x1d.account.v1.RemovePinResponse\x12H\n" + + "\tBlockUser\x12\x1c.account.v1.BlockUserRequest\x1a\x1d.account.v1.BlockUserResponse\x12N\n" + + "\vUnblockUser\x12\x1e.account.v1.UnblockUserRequest\x1a\x1f.account.v1.UnblockUserResponse\x12B\n" + + "\aBlockIp\x12\x1a.account.v1.BlockIpRequest\x1a\x1b.account.v1.BlockIpResponse\x12H\n" + + "\tUnblockIp\x12\x1c.account.v1.UnblockIpRequest\x1a\x1d.account.v1.UnblockIpResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_account_proto_rawDescOnce sync.Once + file_sso_account_proto_rawDescData []byte +) + +func file_sso_account_proto_rawDescGZIP() []byte { + file_sso_account_proto_rawDescOnce.Do(func() { + file_sso_account_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_account_proto_rawDesc), len(file_sso_account_proto_rawDesc))) + }) + return file_sso_account_proto_rawDescData +} + +var file_sso_account_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_sso_account_proto_goTypes = []any{ + (*GetAccountRequest)(nil), // 0: account.v1.GetAccountRequest + (*GetAccountResponse)(nil), // 1: account.v1.GetAccountResponse + (*ChangePasswordRequest)(nil), // 2: account.v1.ChangePasswordRequest + (*ChangePasswordResponse)(nil), // 3: account.v1.ChangePasswordResponse + (*CreateUserRequest)(nil), // 4: account.v1.CreateUserRequest + (*CreateUserResponse)(nil), // 5: account.v1.CreateUserResponse + (*DeleteUserRequest)(nil), // 6: account.v1.DeleteUserRequest + (*DeleteUserResponse)(nil), // 7: account.v1.DeleteUserResponse + (*ChangeDataRequest)(nil), // 8: account.v1.ChangeDataRequest + (*ChangeDataResponse)(nil), // 9: account.v1.ChangeDataResponse + (*AssignRoleRequest)(nil), // 10: account.v1.AssignRoleRequest + (*AssignRoleResponse)(nil), // 11: account.v1.AssignRoleResponse + (*RevokeRoleRequest)(nil), // 12: account.v1.RevokeRoleRequest + (*RevokeRoleResponse)(nil), // 13: account.v1.RevokeRoleResponse + (*AdminResetPasswordRequest)(nil), // 14: account.v1.AdminResetPasswordRequest + (*AdminResetPasswordResponse)(nil), // 15: account.v1.AdminResetPasswordResponse + (*SetPinRequest)(nil), // 16: account.v1.SetPinRequest + (*SetPinResponse)(nil), // 17: account.v1.SetPinResponse + (*UnlockPinRequest)(nil), // 18: account.v1.UnlockPinRequest + (*UnlockPinResponse)(nil), // 19: account.v1.UnlockPinResponse + (*GetPinStatusRequest)(nil), // 20: account.v1.GetPinStatusRequest + (*GetPinStatusResponse)(nil), // 21: account.v1.GetPinStatusResponse + (*RemovePinRequest)(nil), // 22: account.v1.RemovePinRequest + (*RemovePinResponse)(nil), // 23: account.v1.RemovePinResponse + (*BlockUserRequest)(nil), // 24: account.v1.BlockUserRequest + (*BlockUserResponse)(nil), // 25: account.v1.BlockUserResponse + (*UnblockUserRequest)(nil), // 26: account.v1.UnblockUserRequest + (*UnblockUserResponse)(nil), // 27: account.v1.UnblockUserResponse + (*BlockIpRequest)(nil), // 28: account.v1.BlockIpRequest + (*BlockIpResponse)(nil), // 29: account.v1.BlockIpResponse + (*UnblockIpRequest)(nil), // 30: account.v1.UnblockIpRequest + (*UnblockIpResponse)(nil), // 31: account.v1.UnblockIpResponse +} +var file_sso_account_proto_depIdxs = []int32{ + 0, // 0: account.v1.AccountService.GetAccount:input_type -> account.v1.GetAccountRequest + 2, // 1: account.v1.AccountService.ChangePassword:input_type -> account.v1.ChangePasswordRequest + 14, // 2: account.v1.AccountService.AdminResetPassword:input_type -> account.v1.AdminResetPasswordRequest + 4, // 3: account.v1.AccountService.CreateUser:input_type -> account.v1.CreateUserRequest + 6, // 4: account.v1.AccountService.DeleteUser:input_type -> account.v1.DeleteUserRequest + 8, // 5: account.v1.AccountService.ChangeData:input_type -> account.v1.ChangeDataRequest + 10, // 6: account.v1.AccountService.AssignRole:input_type -> account.v1.AssignRoleRequest + 12, // 7: account.v1.AccountService.RevokeRole:input_type -> account.v1.RevokeRoleRequest + 16, // 8: account.v1.AccountService.SetPin:input_type -> account.v1.SetPinRequest + 18, // 9: account.v1.AccountService.UnlockPin:input_type -> account.v1.UnlockPinRequest + 20, // 10: account.v1.AccountService.GetPinStatus:input_type -> account.v1.GetPinStatusRequest + 22, // 11: account.v1.AccountService.RemovePin:input_type -> account.v1.RemovePinRequest + 24, // 12: account.v1.AccountService.BlockUser:input_type -> account.v1.BlockUserRequest + 26, // 13: account.v1.AccountService.UnblockUser:input_type -> account.v1.UnblockUserRequest + 28, // 14: account.v1.AccountService.BlockIp:input_type -> account.v1.BlockIpRequest + 30, // 15: account.v1.AccountService.UnblockIp:input_type -> account.v1.UnblockIpRequest + 1, // 16: account.v1.AccountService.GetAccount:output_type -> account.v1.GetAccountResponse + 3, // 17: account.v1.AccountService.ChangePassword:output_type -> account.v1.ChangePasswordResponse + 15, // 18: account.v1.AccountService.AdminResetPassword:output_type -> account.v1.AdminResetPasswordResponse + 5, // 19: account.v1.AccountService.CreateUser:output_type -> account.v1.CreateUserResponse + 7, // 20: account.v1.AccountService.DeleteUser:output_type -> account.v1.DeleteUserResponse + 9, // 21: account.v1.AccountService.ChangeData:output_type -> account.v1.ChangeDataResponse + 11, // 22: account.v1.AccountService.AssignRole:output_type -> account.v1.AssignRoleResponse + 13, // 23: account.v1.AccountService.RevokeRole:output_type -> account.v1.RevokeRoleResponse + 17, // 24: account.v1.AccountService.SetPin:output_type -> account.v1.SetPinResponse + 19, // 25: account.v1.AccountService.UnlockPin:output_type -> account.v1.UnlockPinResponse + 21, // 26: account.v1.AccountService.GetPinStatus:output_type -> account.v1.GetPinStatusResponse + 23, // 27: account.v1.AccountService.RemovePin:output_type -> account.v1.RemovePinResponse + 25, // 28: account.v1.AccountService.BlockUser:output_type -> account.v1.BlockUserResponse + 27, // 29: account.v1.AccountService.UnblockUser:output_type -> account.v1.UnblockUserResponse + 29, // 30: account.v1.AccountService.BlockIp:output_type -> account.v1.BlockIpResponse + 31, // 31: account.v1.AccountService.UnblockIp:output_type -> account.v1.UnblockIpResponse + 16, // [16:32] is the sub-list for method output_type + 0, // [0:16] 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_sso_account_proto_init() } +func file_sso_account_proto_init() { + if File_sso_account_proto != nil { + return + } + file_sso_account_proto_msgTypes[1].OneofWrappers = []any{} + file_sso_account_proto_msgTypes[2].OneofWrappers = []any{} + file_sso_account_proto_msgTypes[8].OneofWrappers = []any{} + file_sso_account_proto_msgTypes[24].OneofWrappers = []any{} + file_sso_account_proto_msgTypes[28].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_account_proto_rawDesc), len(file_sso_account_proto_rawDesc)), + NumEnums: 0, + NumMessages: 32, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_account_proto_goTypes, + DependencyIndexes: file_sso_account_proto_depIdxs, + MessageInfos: file_sso_account_proto_msgTypes, + }.Build() + File_sso_account_proto = out.File + file_sso_account_proto_goTypes = nil + file_sso_account_proto_depIdxs = nil +} diff --git a/gen/go/sso/account_grpc.pb.go b/gen/go/sso/account_grpc.pb.go new file mode 100644 index 0000000..e714732 --- /dev/null +++ b/gen/go/sso/account_grpc.pb.go @@ -0,0 +1,691 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/account.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AccountService_GetAccount_FullMethodName = "/account.v1.AccountService/GetAccount" + AccountService_ChangePassword_FullMethodName = "/account.v1.AccountService/ChangePassword" + AccountService_AdminResetPassword_FullMethodName = "/account.v1.AccountService/AdminResetPassword" + AccountService_CreateUser_FullMethodName = "/account.v1.AccountService/CreateUser" + AccountService_DeleteUser_FullMethodName = "/account.v1.AccountService/DeleteUser" + AccountService_ChangeData_FullMethodName = "/account.v1.AccountService/ChangeData" + AccountService_AssignRole_FullMethodName = "/account.v1.AccountService/AssignRole" + AccountService_RevokeRole_FullMethodName = "/account.v1.AccountService/RevokeRole" + AccountService_SetPin_FullMethodName = "/account.v1.AccountService/SetPin" + AccountService_UnlockPin_FullMethodName = "/account.v1.AccountService/UnlockPin" + AccountService_GetPinStatus_FullMethodName = "/account.v1.AccountService/GetPinStatus" + AccountService_RemovePin_FullMethodName = "/account.v1.AccountService/RemovePin" + AccountService_BlockUser_FullMethodName = "/account.v1.AccountService/BlockUser" + AccountService_UnblockUser_FullMethodName = "/account.v1.AccountService/UnblockUser" + AccountService_BlockIp_FullMethodName = "/account.v1.AccountService/BlockIp" + AccountService_UnblockIp_FullMethodName = "/account.v1.AccountService/UnblockIp" +) + +// AccountServiceClient is the client API for AccountService 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 AccountServiceClient interface { + GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error) + ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) + AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error) + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) + DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) + ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error) + AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error) + RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) + SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error) + UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error) + GetPinStatus(ctx context.Context, in *GetPinStatusRequest, opts ...grpc.CallOption) (*GetPinStatusResponse, error) + RemovePin(ctx context.Context, in *RemovePinRequest, opts ...grpc.CallOption) (*RemovePinResponse, error) + BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error) + UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error) + BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error) + UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error) +} + +type accountServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient { + return &accountServiceClient{cc} +} + +func (c *accountServiceClient) GetAccount(ctx context.Context, in *GetAccountRequest, opts ...grpc.CallOption) (*GetAccountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAccountResponse) + err := c.cc.Invoke(ctx, AccountService_GetAccount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ChangePasswordResponse) + err := c.cc.Invoke(ctx, AccountService_ChangePassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AdminResetPasswordResponse) + err := c.cc.Invoke(ctx, AccountService_AdminResetPassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateUserResponse) + err := c.cc.Invoke(ctx, AccountService_CreateUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteUserResponse) + err := c.cc.Invoke(ctx, AccountService_DeleteUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ChangeDataResponse) + err := c.cc.Invoke(ctx, AccountService_ChangeData_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AssignRoleResponse) + err := c.cc.Invoke(ctx, AccountService_AssignRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RevokeRoleResponse) + err := c.cc.Invoke(ctx, AccountService_RevokeRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) SetPin(ctx context.Context, in *SetPinRequest, opts ...grpc.CallOption) (*SetPinResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SetPinResponse) + err := c.cc.Invoke(ctx, AccountService_SetPin_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UnlockPinResponse) + err := c.cc.Invoke(ctx, AccountService_UnlockPin_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) GetPinStatus(ctx context.Context, in *GetPinStatusRequest, opts ...grpc.CallOption) (*GetPinStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPinStatusResponse) + err := c.cc.Invoke(ctx, AccountService_GetPinStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) RemovePin(ctx context.Context, in *RemovePinRequest, opts ...grpc.CallOption) (*RemovePinResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RemovePinResponse) + err := c.cc.Invoke(ctx, AccountService_RemovePin_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockUserResponse) + err := c.cc.Invoke(ctx, AccountService_BlockUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UnblockUserResponse) + err := c.cc.Invoke(ctx, AccountService_UnblockUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockIpResponse) + err := c.cc.Invoke(ctx, AccountService_BlockIp_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UnblockIpResponse) + err := c.cc.Invoke(ctx, AccountService_UnblockIp_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountServiceServer is the server API for AccountService service. +// All implementations must embed UnimplementedAccountServiceServer +// for forward compatibility. +type AccountServiceServer interface { + GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error) + ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) + AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error) + CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) + DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) + ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) + AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error) + RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) + SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) + UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) + GetPinStatus(context.Context, *GetPinStatusRequest) (*GetPinStatusResponse, error) + RemovePin(context.Context, *RemovePinRequest) (*RemovePinResponse, error) + BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error) + UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error) + BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error) + UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error) + mustEmbedUnimplementedAccountServiceServer() +} + +// UnimplementedAccountServiceServer must 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 UnimplementedAccountServiceServer struct{} + +func (UnimplementedAccountServiceServer) GetAccount(context.Context, *GetAccountRequest) (*GetAccountResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAccount not implemented") +} +func (UnimplementedAccountServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ChangePassword not implemented") +} +func (UnimplementedAccountServiceServer) AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error) { + return nil, status.Error(codes.Unimplemented, "method AdminResetPassword not implemented") +} +func (UnimplementedAccountServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedAccountServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedAccountServiceServer) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ChangeData not implemented") +} +func (UnimplementedAccountServiceServer) AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method AssignRole not implemented") +} +func (UnimplementedAccountServiceServer) RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RevokeRole not implemented") +} +func (UnimplementedAccountServiceServer) SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SetPin not implemented") +} +func (UnimplementedAccountServiceServer) UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UnlockPin not implemented") +} +func (UnimplementedAccountServiceServer) GetPinStatus(context.Context, *GetPinStatusRequest) (*GetPinStatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetPinStatus not implemented") +} +func (UnimplementedAccountServiceServer) RemovePin(context.Context, *RemovePinRequest) (*RemovePinResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RemovePin not implemented") +} +func (UnimplementedAccountServiceServer) BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error) { + return nil, status.Error(codes.Unimplemented, "method BlockUser not implemented") +} +func (UnimplementedAccountServiceServer) UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UnblockUser not implemented") +} +func (UnimplementedAccountServiceServer) BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error) { + return nil, status.Error(codes.Unimplemented, "method BlockIp not implemented") +} +func (UnimplementedAccountServiceServer) UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UnblockIp not implemented") +} +func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {} +func (UnimplementedAccountServiceServer) testEmbeddedByValue() {} + +// UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountServiceServer will +// result in compilation errors. +type UnsafeAccountServiceServer interface { + mustEmbedUnimplementedAccountServiceServer() +} + +func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceServer) { + // If the following call panics, it indicates UnimplementedAccountServiceServer 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(&AccountService_ServiceDesc, srv) +} + +func _AccountService_GetAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).GetAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_GetAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).GetAccount(ctx, req.(*GetAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangePasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).ChangePassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_ChangePassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_AdminResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminResetPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).AdminResetPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_AdminResetPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).AdminResetPassword(ctx, req.(*AdminResetPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_ChangeData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangeDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).ChangeData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_ChangeData_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).ChangeData(ctx, req.(*ChangeDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_AssignRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AssignRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).AssignRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_AssignRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).AssignRole(ctx, req.(*AssignRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_RevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RevokeRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).RevokeRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_RevokeRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).RevokeRole(ctx, req.(*RevokeRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_SetPin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetPinRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).SetPin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_SetPin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).SetPin(ctx, req.(*SetPinRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_UnlockPin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnlockPinRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).UnlockPin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_UnlockPin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).UnlockPin(ctx, req.(*UnlockPinRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_GetPinStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPinStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).GetPinStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_GetPinStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).GetPinStatus(ctx, req.(*GetPinStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_RemovePin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemovePinRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).RemovePin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_RemovePin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).RemovePin(ctx, req.(*RemovePinRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).BlockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_BlockUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).BlockUser(ctx, req.(*BlockUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_UnblockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnblockUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).UnblockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_UnblockUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).UnblockUser(ctx, req.(*UnblockUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_BlockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockIpRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).BlockIp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_BlockIp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).BlockIp(ctx, req.(*BlockIpRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_UnblockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnblockIpRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).UnblockIp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountService_UnblockIp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).UnblockIp(ctx, req.(*UnblockIpRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AccountService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "account.v1.AccountService", + HandlerType: (*AccountServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAccount", + Handler: _AccountService_GetAccount_Handler, + }, + { + MethodName: "ChangePassword", + Handler: _AccountService_ChangePassword_Handler, + }, + { + MethodName: "AdminResetPassword", + Handler: _AccountService_AdminResetPassword_Handler, + }, + { + MethodName: "CreateUser", + Handler: _AccountService_CreateUser_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _AccountService_DeleteUser_Handler, + }, + { + MethodName: "ChangeData", + Handler: _AccountService_ChangeData_Handler, + }, + { + MethodName: "AssignRole", + Handler: _AccountService_AssignRole_Handler, + }, + { + MethodName: "RevokeRole", + Handler: _AccountService_RevokeRole_Handler, + }, + { + MethodName: "SetPin", + Handler: _AccountService_SetPin_Handler, + }, + { + MethodName: "UnlockPin", + Handler: _AccountService_UnlockPin_Handler, + }, + { + MethodName: "GetPinStatus", + Handler: _AccountService_GetPinStatus_Handler, + }, + { + MethodName: "RemovePin", + Handler: _AccountService_RemovePin_Handler, + }, + { + MethodName: "BlockUser", + Handler: _AccountService_BlockUser_Handler, + }, + { + MethodName: "UnblockUser", + Handler: _AccountService_UnblockUser_Handler, + }, + { + MethodName: "BlockIp", + Handler: _AccountService_BlockIp_Handler, + }, + { + MethodName: "UnblockIp", + Handler: _AccountService_UnblockIp_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/account.proto", +} diff --git a/gen/go/sso/auth.pb.go b/gen/go/sso/auth.pb.go new file mode 100644 index 0000000..481d389 --- /dev/null +++ b/gen/go/sso/auth.pb.go @@ -0,0 +1,1054 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/auth.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 LoginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + mi := &file_sso_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type LoginResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Need2Fa bool `protobuf:"varint,4,opt,name=need2fa,proto3" json:"need2fa,omitempty"` + TempToken *string `protobuf:"bytes,5,opt,name=temp_token,json=tempToken,proto3,oneof" json:"temp_token,omitempty"` + Message *string `protobuf:"bytes,6,opt,name=message,proto3,oneof" json:"message,omitempty"` + ErrorCode *string `protobuf:"bytes,7,opt,name=error_code,json=errorCode,proto3,oneof" json:"error_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LoginResponse) Reset() { + *x = LoginResponse{} + mi := &file_sso_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginResponse) ProtoMessage() {} + +func (x *LoginResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead. +func (*LoginResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *LoginResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *LoginResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *LoginResponse) GetNeed2Fa() bool { + if x != nil { + return x.Need2Fa + } + return false +} + +func (x *LoginResponse) GetTempToken() string { + if x != nil && x.TempToken != nil { + return *x.TempToken + } + return "" +} + +func (x *LoginResponse) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *LoginResponse) GetErrorCode() string { + if x != nil && x.ErrorCode != nil { + return *x.ErrorCode + } + return "" +} + +type RefreshRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RefreshRequest) Reset() { + *x = RefreshRequest{} + mi := &file_sso_auth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RefreshRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshRequest) ProtoMessage() {} + +func (x *RefreshRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshRequest.ProtoReflect.Descriptor instead. +func (*RefreshRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{2} +} + +func (x *RefreshRequest) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +type RefreshResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RefreshResponse) Reset() { + *x = RefreshResponse{} + mi := &file_sso_auth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RefreshResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshResponse) ProtoMessage() {} + +func (x *RefreshResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshResponse.ProtoReflect.Descriptor instead. +func (*RefreshResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{3} +} + +func (x *RefreshResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *RefreshResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +type LogoutRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogoutRequest) Reset() { + *x = LogoutRequest{} + mi := &file_sso_auth_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogoutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutRequest) ProtoMessage() {} + +func (x *LogoutRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead. +func (*LogoutRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{4} +} + +func (x *LogoutRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *LogoutRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type LogoutResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LogoutResponse) Reset() { + *x = LogoutResponse{} + mi := &file_sso_auth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LogoutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogoutResponse) ProtoMessage() {} + +func (x *LogoutResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead. +func (*LogoutResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{5} +} + +func (x *LogoutResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *LogoutResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type VerifyTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VerifyTokenRequest) Reset() { + *x = VerifyTokenRequest{} + mi := &file_sso_auth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VerifyTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyTokenRequest) ProtoMessage() {} + +func (x *VerifyTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyTokenRequest.ProtoReflect.Descriptor instead. +func (*VerifyTokenRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{6} +} + +func (x *VerifyTokenRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type VerifyTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + IsValid bool `protobuf:"varint,1,opt,name=is_valid,json=isValid,proto3" json:"is_valid,omitempty"` + ErrorMessage *string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3,oneof" json:"error_message,omitempty"` + Id *string `protobuf:"bytes,3,opt,name=id,proto3,oneof" json:"id,omitempty"` + Username *string `protobuf:"bytes,4,opt,name=username,proto3,oneof" json:"username,omitempty"` + RoleLevel *int32 `protobuf:"varint,5,opt,name=role_level,json=roleLevel,proto3,oneof" json:"role_level,omitempty"` + Permissions []string `protobuf:"bytes,6,rep,name=permissions,proto3" json:"permissions,omitempty"` + SessionId *string `protobuf:"bytes,7,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` + RequiresPin *bool `protobuf:"varint,8,opt,name=requires_pin,json=requiresPin,proto3,oneof" json:"requires_pin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VerifyTokenResponse) Reset() { + *x = VerifyTokenResponse{} + mi := &file_sso_auth_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VerifyTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyTokenResponse) ProtoMessage() {} + +func (x *VerifyTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyTokenResponse.ProtoReflect.Descriptor instead. +func (*VerifyTokenResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{7} +} + +func (x *VerifyTokenResponse) GetIsValid() bool { + if x != nil { + return x.IsValid + } + return false +} + +func (x *VerifyTokenResponse) GetErrorMessage() string { + if x != nil && x.ErrorMessage != nil { + return *x.ErrorMessage + } + return "" +} + +func (x *VerifyTokenResponse) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return "" +} + +func (x *VerifyTokenResponse) GetUsername() string { + if x != nil && x.Username != nil { + return *x.Username + } + return "" +} + +func (x *VerifyTokenResponse) GetRoleLevel() int32 { + if x != nil && x.RoleLevel != nil { + return *x.RoleLevel + } + return 0 +} + +func (x *VerifyTokenResponse) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *VerifyTokenResponse) GetSessionId() string { + if x != nil && x.SessionId != nil { + return *x.SessionId + } + return "" +} + +func (x *VerifyTokenResponse) GetRequiresPin() bool { + if x != nil && x.RequiresPin != nil { + return *x.RequiresPin + } + return false +} + +type GetAccountRoleLevelRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountRoleLevelRequest) Reset() { + *x = GetAccountRoleLevelRequest{} + mi := &file_sso_auth_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountRoleLevelRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountRoleLevelRequest) ProtoMessage() {} + +func (x *GetAccountRoleLevelRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountRoleLevelRequest.ProtoReflect.Descriptor instead. +func (*GetAccountRoleLevelRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{8} +} + +func (x *GetAccountRoleLevelRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +type GetAccountRoleLevelResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Found bool `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"` + RoleLevel int32 `protobuf:"varint,2,opt,name=role_level,json=roleLevel,proto3" json:"role_level,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAccountRoleLevelResponse) Reset() { + *x = GetAccountRoleLevelResponse{} + mi := &file_sso_auth_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAccountRoleLevelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountRoleLevelResponse) ProtoMessage() {} + +func (x *GetAccountRoleLevelResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountRoleLevelResponse.ProtoReflect.Descriptor instead. +func (*GetAccountRoleLevelResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{9} +} + +func (x *GetAccountRoleLevelResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +func (x *GetAccountRoleLevelResponse) GetRoleLevel() int32 { + if x != nil { + return x.RoleLevel + } + return 0 +} + +type GetSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + CurrentSessionId string `protobuf:"bytes,2,opt,name=current_session_id,json=currentSessionId,proto3" json:"current_session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionRequest) Reset() { + *x = GetSessionRequest{} + mi := &file_sso_auth_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionRequest) ProtoMessage() {} + +func (x *GetSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead. +func (*GetSessionRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{10} +} + +func (x *GetSessionRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetSessionRequest) GetCurrentSessionId() string { + if x != nil { + return x.CurrentSessionId + } + return "" +} + +type SessionItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Здесь будет лежать захэшированный ID + IpAddress string `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` + UserAgent string `protobuf:"bytes,3,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` + LastActivity int64 `protobuf:"varint,4,opt,name=last_activity,json=lastActivity,proto3" json:"last_activity,omitempty"` // Unix timestamp в миллисекундах + IsCurrent bool `protobuf:"varint,5,opt,name=is_current,json=isCurrent,proto3" json:"is_current,omitempty"` // Флаг текущей сессии + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SessionItem) Reset() { + *x = SessionItem{} + mi := &file_sso_auth_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SessionItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionItem) ProtoMessage() {} + +func (x *SessionItem) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionItem.ProtoReflect.Descriptor instead. +func (*SessionItem) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{11} +} + +func (x *SessionItem) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SessionItem) GetIpAddress() string { + if x != nil { + return x.IpAddress + } + return "" +} + +func (x *SessionItem) GetUserAgent() string { + if x != nil { + return x.UserAgent + } + return "" +} + +func (x *SessionItem) GetLastActivity() int64 { + if x != nil { + return x.LastActivity + } + return 0 +} + +func (x *SessionItem) GetIsCurrent() bool { + if x != nil { + return x.IsCurrent + } + return false +} + +type GetSessionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sessions []*SessionItem `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSessionsResponse) Reset() { + *x = GetSessionsResponse{} + mi := &file_sso_auth_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSessionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSessionsResponse) ProtoMessage() {} + +func (x *GetSessionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSessionsResponse.ProtoReflect.Descriptor instead. +func (*GetSessionsResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{12} +} + +func (x *GetSessionsResponse) GetSessions() []*SessionItem { + if x != nil { + return x.Sessions + } + return nil +} + +type TerminateSessionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + TargetHash string `protobuf:"bytes,2,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"` // Хэш сессии, которую нужно убить + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateSessionRequest) Reset() { + *x = TerminateSessionRequest{} + mi := &file_sso_auth_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateSessionRequest) ProtoMessage() {} + +func (x *TerminateSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateSessionRequest.ProtoReflect.Descriptor instead. +func (*TerminateSessionRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{13} +} + +func (x *TerminateSessionRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *TerminateSessionRequest) GetTargetHash() string { + if x != nil { + return x.TargetHash + } + return "" +} + +type TerminateSessionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateSessionResponse) Reset() { + *x = TerminateSessionResponse{} + mi := &file_sso_auth_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateSessionResponse) ProtoMessage() {} + +func (x *TerminateSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateSessionResponse.ProtoReflect.Descriptor instead. +func (*TerminateSessionResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{14} +} + +func (x *TerminateSessionResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *TerminateSessionResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_sso_auth_proto protoreflect.FileDescriptor + +const file_sso_auth_proto_rawDesc = "" + + "\n" + + "\x0esso/auth.proto\x12\aauth.v1\"F\n" + + "\fLoginRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"\x9a\x02\n" + + "\rLoginResponse\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + + "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + + "\aneed2fa\x18\x04 \x01(\bR\aneed2fa\x12\"\n" + + "\n" + + "temp_token\x18\x05 \x01(\tH\x00R\ttempToken\x88\x01\x01\x12\x1d\n" + + "\amessage\x18\x06 \x01(\tH\x01R\amessage\x88\x01\x01\x12\"\n" + + "\n" + + "error_code\x18\a \x01(\tH\x02R\terrorCode\x88\x01\x01B\r\n" + + "\v_temp_tokenB\n" + + "\n" + + "\b_messageB\r\n" + + "\v_error_code\"5\n" + + "\x0eRefreshRequest\x12#\n" + + "\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\"Y\n" + + "\x0fRefreshResponse\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + + "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\"G\n" + + "\rLogoutRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"D\n" + + "\x0eLogoutResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"*\n" + + "\x12VerifyTokenRequest\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\"\xf7\x02\n" + + "\x13VerifyTokenResponse\x12\x19\n" + + "\bis_valid\x18\x01 \x01(\bR\aisValid\x12(\n" + + "\rerror_message\x18\x02 \x01(\tH\x00R\ferrorMessage\x88\x01\x01\x12\x13\n" + + "\x02id\x18\x03 \x01(\tH\x01R\x02id\x88\x01\x01\x12\x1f\n" + + "\busername\x18\x04 \x01(\tH\x02R\busername\x88\x01\x01\x12\"\n" + + "\n" + + "role_level\x18\x05 \x01(\x05H\x03R\troleLevel\x88\x01\x01\x12 \n" + + "\vpermissions\x18\x06 \x03(\tR\vpermissions\x12\"\n" + + "\n" + + "session_id\x18\a \x01(\tH\x04R\tsessionId\x88\x01\x01\x12&\n" + + "\frequires_pin\x18\b \x01(\bH\x05R\vrequiresPin\x88\x01\x01B\x10\n" + + "\x0e_error_messageB\x05\n" + + "\x03_idB\v\n" + + "\t_usernameB\r\n" + + "\v_role_levelB\r\n" + + "\v_session_idB\x0f\n" + + "\r_requires_pin\";\n" + + "\x1aGetAccountRoleLevelRequest\x12\x1d\n" + + "\n" + + "account_id\x18\x01 \x01(\tR\taccountId\"R\n" + + "\x1bGetAccountRoleLevelResponse\x12\x14\n" + + "\x05found\x18\x01 \x01(\bR\x05found\x12\x1d\n" + + "\n" + + "role_level\x18\x02 \x01(\x05R\troleLevel\"Z\n" + + "\x11GetSessionRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12,\n" + + "\x12current_session_id\x18\x02 \x01(\tR\x10currentSessionId\"\x9f\x01\n" + + "\vSessionItem\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" + + "\n" + + "ip_address\x18\x02 \x01(\tR\tipAddress\x12\x1d\n" + + "\n" + + "user_agent\x18\x03 \x01(\tR\tuserAgent\x12#\n" + + "\rlast_activity\x18\x04 \x01(\x03R\flastActivity\x12\x1d\n" + + "\n" + + "is_current\x18\x05 \x01(\bR\tisCurrent\"G\n" + + "\x13GetSessionsResponse\x120\n" + + "\bsessions\x18\x01 \x03(\v2\x14.auth.v1.SessionItemR\bsessions\"S\n" + + "\x17TerminateSessionRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1f\n" + + "\vtarget_hash\x18\x02 \x01(\tR\n" + + "targetHash\"N\n" + + "\x18TerminateSessionResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage2\xcc\x04\n" + + "\vAuthService\x126\n" + + "\x05Login\x12\x15.auth.v1.LoginRequest\x1a\x16.auth.v1.LoginResponse\x12<\n" + + "\aRefresh\x12\x17.auth.v1.RefreshRequest\x1a\x18.auth.v1.RefreshResponse\x12H\n" + + "\vVerifyToken\x12\x1b.auth.v1.VerifyTokenRequest\x1a\x1c.auth.v1.VerifyTokenResponse\x12`\n" + + "\x13GetAccountRoleLevel\x12#.auth.v1.GetAccountRoleLevelRequest\x1a$.auth.v1.GetAccountRoleLevelResponse\x129\n" + + "\x06Logout\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponse\x12>\n" + + "\vLogoutOther\x12\x16.auth.v1.LogoutRequest\x1a\x17.auth.v1.LogoutResponse\x12G\n" + + "\vGetSessions\x12\x1a.auth.v1.GetSessionRequest\x1a\x1c.auth.v1.GetSessionsResponse\x12W\n" + + "\x10TerminateSession\x12 .auth.v1.TerminateSessionRequest\x1a!.auth.v1.TerminateSessionResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_auth_proto_rawDescOnce sync.Once + file_sso_auth_proto_rawDescData []byte +) + +func file_sso_auth_proto_rawDescGZIP() []byte { + file_sso_auth_proto_rawDescOnce.Do(func() { + file_sso_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_auth_proto_rawDesc), len(file_sso_auth_proto_rawDesc))) + }) + return file_sso_auth_proto_rawDescData +} + +var file_sso_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_sso_auth_proto_goTypes = []any{ + (*LoginRequest)(nil), // 0: auth.v1.LoginRequest + (*LoginResponse)(nil), // 1: auth.v1.LoginResponse + (*RefreshRequest)(nil), // 2: auth.v1.RefreshRequest + (*RefreshResponse)(nil), // 3: auth.v1.RefreshResponse + (*LogoutRequest)(nil), // 4: auth.v1.LogoutRequest + (*LogoutResponse)(nil), // 5: auth.v1.LogoutResponse + (*VerifyTokenRequest)(nil), // 6: auth.v1.VerifyTokenRequest + (*VerifyTokenResponse)(nil), // 7: auth.v1.VerifyTokenResponse + (*GetAccountRoleLevelRequest)(nil), // 8: auth.v1.GetAccountRoleLevelRequest + (*GetAccountRoleLevelResponse)(nil), // 9: auth.v1.GetAccountRoleLevelResponse + (*GetSessionRequest)(nil), // 10: auth.v1.GetSessionRequest + (*SessionItem)(nil), // 11: auth.v1.SessionItem + (*GetSessionsResponse)(nil), // 12: auth.v1.GetSessionsResponse + (*TerminateSessionRequest)(nil), // 13: auth.v1.TerminateSessionRequest + (*TerminateSessionResponse)(nil), // 14: auth.v1.TerminateSessionResponse +} +var file_sso_auth_proto_depIdxs = []int32{ + 11, // 0: auth.v1.GetSessionsResponse.sessions:type_name -> auth.v1.SessionItem + 0, // 1: auth.v1.AuthService.Login:input_type -> auth.v1.LoginRequest + 2, // 2: auth.v1.AuthService.Refresh:input_type -> auth.v1.RefreshRequest + 6, // 3: auth.v1.AuthService.VerifyToken:input_type -> auth.v1.VerifyTokenRequest + 8, // 4: auth.v1.AuthService.GetAccountRoleLevel:input_type -> auth.v1.GetAccountRoleLevelRequest + 4, // 5: auth.v1.AuthService.Logout:input_type -> auth.v1.LogoutRequest + 4, // 6: auth.v1.AuthService.LogoutOther:input_type -> auth.v1.LogoutRequest + 10, // 7: auth.v1.AuthService.GetSessions:input_type -> auth.v1.GetSessionRequest + 13, // 8: auth.v1.AuthService.TerminateSession:input_type -> auth.v1.TerminateSessionRequest + 1, // 9: auth.v1.AuthService.Login:output_type -> auth.v1.LoginResponse + 3, // 10: auth.v1.AuthService.Refresh:output_type -> auth.v1.RefreshResponse + 7, // 11: auth.v1.AuthService.VerifyToken:output_type -> auth.v1.VerifyTokenResponse + 9, // 12: auth.v1.AuthService.GetAccountRoleLevel:output_type -> auth.v1.GetAccountRoleLevelResponse + 5, // 13: auth.v1.AuthService.Logout:output_type -> auth.v1.LogoutResponse + 5, // 14: auth.v1.AuthService.LogoutOther:output_type -> auth.v1.LogoutResponse + 12, // 15: auth.v1.AuthService.GetSessions:output_type -> auth.v1.GetSessionsResponse + 14, // 16: auth.v1.AuthService.TerminateSession:output_type -> auth.v1.TerminateSessionResponse + 9, // [9:17] is the sub-list for method output_type + 1, // [1:9] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sso_auth_proto_init() } +func file_sso_auth_proto_init() { + if File_sso_auth_proto != nil { + return + } + file_sso_auth_proto_msgTypes[1].OneofWrappers = []any{} + file_sso_auth_proto_msgTypes[7].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_auth_proto_rawDesc), len(file_sso_auth_proto_rawDesc)), + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_auth_proto_goTypes, + DependencyIndexes: file_sso_auth_proto_depIdxs, + MessageInfos: file_sso_auth_proto_msgTypes, + }.Build() + File_sso_auth_proto = out.File + file_sso_auth_proto_goTypes = nil + file_sso_auth_proto_depIdxs = nil +} diff --git a/gen/go/sso/auth_grpc.pb.go b/gen/go/sso/auth_grpc.pb.go new file mode 100644 index 0000000..c842ec5 --- /dev/null +++ b/gen/go/sso/auth_grpc.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/auth.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + AuthService_Login_FullMethodName = "/auth.v1.AuthService/Login" + AuthService_Refresh_FullMethodName = "/auth.v1.AuthService/Refresh" + AuthService_VerifyToken_FullMethodName = "/auth.v1.AuthService/VerifyToken" + AuthService_GetAccountRoleLevel_FullMethodName = "/auth.v1.AuthService/GetAccountRoleLevel" + AuthService_Logout_FullMethodName = "/auth.v1.AuthService/Logout" + AuthService_LogoutOther_FullMethodName = "/auth.v1.AuthService/LogoutOther" + AuthService_GetSessions_FullMethodName = "/auth.v1.AuthService/GetSessions" + AuthService_TerminateSession_FullMethodName = "/auth.v1.AuthService/TerminateSession" +) + +// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface { + Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) + VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error) + GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error) + Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) + LogoutOther(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) + GetSessions(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error) + TerminateSession(ctx context.Context, in *TerminateSessionRequest, opts ...grpc.CallOption) (*TerminateSessionResponse, error) +} + +type authServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { + return &authServiceClient{cc} +} + +func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LoginResponse) + err := c.cc.Invoke(ctx, AuthService_Login_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RefreshResponse) + err := c.cc.Invoke(ctx, AuthService_Refresh_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VerifyTokenResponse) + err := c.cc.Invoke(ctx, AuthService_VerifyToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) GetAccountRoleLevel(ctx context.Context, in *GetAccountRoleLevelRequest, opts ...grpc.CallOption) (*GetAccountRoleLevelResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAccountRoleLevelResponse) + err := c.cc.Invoke(ctx, AuthService_GetAccountRoleLevel_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LogoutResponse) + err := c.cc.Invoke(ctx, AuthService_Logout_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) LogoutOther(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LogoutResponse) + err := c.cc.Invoke(ctx, AuthService_LogoutOther_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) GetSessions(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSessionsResponse) + err := c.cc.Invoke(ctx, AuthService_GetSessions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authServiceClient) TerminateSession(ctx context.Context, in *TerminateSessionRequest, opts ...grpc.CallOption) (*TerminateSessionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TerminateSessionResponse) + err := c.cc.Invoke(ctx, AuthService_TerminateSession_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthServiceServer is the server API for AuthService service. +// All implementations must embed UnimplementedAuthServiceServer +// for forward compatibility. +type AuthServiceServer interface { + Login(context.Context, *LoginRequest) (*LoginResponse, error) + Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) + VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) + GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error) + Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) + LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error) + GetSessions(context.Context, *GetSessionRequest) (*GetSessionsResponse, error) + TerminateSession(context.Context, *TerminateSessionRequest) (*TerminateSessionResponse, error) + mustEmbedUnimplementedAuthServiceServer() +} + +// UnimplementedAuthServiceServer must 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 UnimplementedAuthServiceServer struct{} + +func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedAuthServiceServer) Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Refresh not implemented") +} +func (UnimplementedAuthServiceServer) VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) { + return nil, status.Error(codes.Unimplemented, "method VerifyToken not implemented") +} +func (UnimplementedAuthServiceServer) GetAccountRoleLevel(context.Context, *GetAccountRoleLevelRequest) (*GetAccountRoleLevelResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAccountRoleLevel not implemented") +} +func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Logout not implemented") +} +func (UnimplementedAuthServiceServer) LogoutOther(context.Context, *LogoutRequest) (*LogoutResponse, error) { + return nil, status.Error(codes.Unimplemented, "method LogoutOther not implemented") +} +func (UnimplementedAuthServiceServer) GetSessions(context.Context, *GetSessionRequest) (*GetSessionsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetSessions not implemented") +} +func (UnimplementedAuthServiceServer) TerminateSession(context.Context, *TerminateSessionRequest) (*TerminateSessionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TerminateSession not implemented") +} +func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} +func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthServiceServer will +// result in compilation errors. +type UnsafeAuthServiceServer interface { + mustEmbedUnimplementedAuthServiceServer() +} + +func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { + // If the following call panics, it indicates UnimplementedAuthServiceServer 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(&AuthService_ServiceDesc, srv) +} + +func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).Login(ctx, req.(*LoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).Refresh(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_Refresh_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).Refresh(ctx, req.(*RefreshRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).VerifyToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_VerifyToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).VerifyToken(ctx, req.(*VerifyTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_GetAccountRoleLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAccountRoleLevelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).GetAccountRoleLevel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_GetAccountRoleLevel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).GetAccountRoleLevel(ctx, req.(*GetAccountRoleLevelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_Logout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).Logout(ctx, req.(*LogoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_LogoutOther_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LogoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).LogoutOther(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_LogoutOther_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).LogoutOther(ctx, req.(*LogoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_GetSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).GetSessions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_GetSessions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).GetSessions(ctx, req.(*GetSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthService_TerminateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TerminateSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).TerminateSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_TerminateSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).TerminateSession(ctx, req.(*TerminateSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "auth.v1.AuthService", + HandlerType: (*AuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Login", + Handler: _AuthService_Login_Handler, + }, + { + MethodName: "Refresh", + Handler: _AuthService_Refresh_Handler, + }, + { + MethodName: "VerifyToken", + Handler: _AuthService_VerifyToken_Handler, + }, + { + MethodName: "GetAccountRoleLevel", + Handler: _AuthService_GetAccountRoleLevel_Handler, + }, + { + MethodName: "Logout", + Handler: _AuthService_Logout_Handler, + }, + { + MethodName: "LogoutOther", + Handler: _AuthService_LogoutOther_Handler, + }, + { + MethodName: "GetSessions", + Handler: _AuthService_GetSessions_Handler, + }, + { + MethodName: "TerminateSession", + Handler: _AuthService_TerminateSession_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/auth.proto", +} diff --git a/gen/go/sso/ldap-auth.pb.go b/gen/go/sso/ldap-auth.pb.go new file mode 100644 index 0000000..14dd06b --- /dev/null +++ b/gen/go/sso/ldap-auth.pb.go @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/ldap-auth.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 VerifyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VerifyRequest) Reset() { + *x = VerifyRequest{} + mi := &file_sso_ldap_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VerifyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyRequest) ProtoMessage() {} + +func (x *VerifyRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_auth_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead. +func (*VerifyRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *VerifyRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *VerifyRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type VerifyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + User *UserData `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // Отдаем полные данные при успешном входе + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VerifyResponse) Reset() { + *x = VerifyResponse{} + mi := &file_sso_ldap_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VerifyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyResponse) ProtoMessage() {} + +func (x *VerifyResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_auth_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead. +func (*VerifyResponse) Descriptor() ([]byte, []int) { + return file_sso_ldap_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *VerifyResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *VerifyResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *VerifyResponse) GetUser() *UserData { + if x != nil { + return x.User + } + return nil +} + +var File_sso_ldap_auth_proto protoreflect.FileDescriptor + +const file_sso_ldap_auth_proto_rawDesc = "" + + "\n" + + "\x13sso/ldap-auth.proto\x12\fldap_auth.v1\x1a\x0esso/ldap.proto\"G\n" + + "\rVerifyRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"v\n" + + "\x0eVerifyResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12%\n" + + "\x04user\x18\x03 \x01(\v2\x11.ldap.v1.UserDataR\x04user2Z\n" + + "\x0fLdapAuthService\x12G\n" + + "\n" + + "VerifyUser\x12\x1b.ldap_auth.v1.VerifyRequest\x1a\x1c.ldap_auth.v1.VerifyResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_ldap_auth_proto_rawDescOnce sync.Once + file_sso_ldap_auth_proto_rawDescData []byte +) + +func file_sso_ldap_auth_proto_rawDescGZIP() []byte { + file_sso_ldap_auth_proto_rawDescOnce.Do(func() { + file_sso_ldap_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_ldap_auth_proto_rawDesc), len(file_sso_ldap_auth_proto_rawDesc))) + }) + return file_sso_ldap_auth_proto_rawDescData +} + +var file_sso_ldap_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sso_ldap_auth_proto_goTypes = []any{ + (*VerifyRequest)(nil), // 0: ldap_auth.v1.VerifyRequest + (*VerifyResponse)(nil), // 1: ldap_auth.v1.VerifyResponse + (*UserData)(nil), // 2: ldap.v1.UserData +} +var file_sso_ldap_auth_proto_depIdxs = []int32{ + 2, // 0: ldap_auth.v1.VerifyResponse.user:type_name -> ldap.v1.UserData + 0, // 1: ldap_auth.v1.LdapAuthService.VerifyUser:input_type -> ldap_auth.v1.VerifyRequest + 1, // 2: ldap_auth.v1.LdapAuthService.VerifyUser:output_type -> ldap_auth.v1.VerifyResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sso_ldap_auth_proto_init() } +func file_sso_ldap_auth_proto_init() { + if File_sso_ldap_auth_proto != nil { + return + } + file_sso_ldap_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_ldap_auth_proto_rawDesc), len(file_sso_ldap_auth_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_ldap_auth_proto_goTypes, + DependencyIndexes: file_sso_ldap_auth_proto_depIdxs, + MessageInfos: file_sso_ldap_auth_proto_msgTypes, + }.Build() + File_sso_ldap_auth_proto = out.File + file_sso_ldap_auth_proto_goTypes = nil + file_sso_ldap_auth_proto_depIdxs = nil +} diff --git a/gen/go/sso/ldap-auth_grpc.pb.go b/gen/go/sso/ldap-auth_grpc.pb.go new file mode 100644 index 0000000..d3318b6 --- /dev/null +++ b/gen/go/sso/ldap-auth_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/ldap-auth.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + LdapAuthService_VerifyUser_FullMethodName = "/ldap_auth.v1.LdapAuthService/VerifyUser" +) + +// LdapAuthServiceClient is the client API for LdapAuthService 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 LdapAuthServiceClient interface { + VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) +} + +type ldapAuthServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLdapAuthServiceClient(cc grpc.ClientConnInterface) LdapAuthServiceClient { + return &ldapAuthServiceClient{cc} +} + +func (c *ldapAuthServiceClient) VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VerifyResponse) + err := c.cc.Invoke(ctx, LdapAuthService_VerifyUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LdapAuthServiceServer is the server API for LdapAuthService service. +// All implementations must embed UnimplementedLdapAuthServiceServer +// for forward compatibility. +type LdapAuthServiceServer interface { + VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) + mustEmbedUnimplementedLdapAuthServiceServer() +} + +// UnimplementedLdapAuthServiceServer must 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 UnimplementedLdapAuthServiceServer struct{} + +func (UnimplementedLdapAuthServiceServer) VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) { + return nil, status.Error(codes.Unimplemented, "method VerifyUser not implemented") +} +func (UnimplementedLdapAuthServiceServer) mustEmbedUnimplementedLdapAuthServiceServer() {} +func (UnimplementedLdapAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeLdapAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LdapAuthServiceServer will +// result in compilation errors. +type UnsafeLdapAuthServiceServer interface { + mustEmbedUnimplementedLdapAuthServiceServer() +} + +func RegisterLdapAuthServiceServer(s grpc.ServiceRegistrar, srv LdapAuthServiceServer) { + // If the following call panics, it indicates UnimplementedLdapAuthServiceServer 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(&LdapAuthService_ServiceDesc, srv) +} + +func _LdapAuthService_VerifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapAuthServiceServer).VerifyUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapAuthService_VerifyUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapAuthServiceServer).VerifyUser(ctx, req.(*VerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LdapAuthService_ServiceDesc is the grpc.ServiceDesc for LdapAuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LdapAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ldap_auth.v1.LdapAuthService", + HandlerType: (*LdapAuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "VerifyUser", + Handler: _LdapAuthService_VerifyUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/ldap-auth.proto", +} diff --git a/gen/go/sso/ldap.pb.go b/gen/go/sso/ldap.pb.go new file mode 100644 index 0000000..98d97a6 --- /dev/null +++ b/gen/go/sso/ldap.pb.go @@ -0,0 +1,846 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/ldap.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 EmptyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyRequest) Reset() { + *x = EmptyRequest{} + mi := &file_sso_ldap_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRequest) ProtoMessage() {} + +func (x *EmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. +func (*EmptyRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{0} +} + +// Стандартный ответ для мутаций (создание, обновление, удаление) +type StatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusResponse) Reset() { + *x = StatusResponse{} + mi := &file_sso_ldap_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusResponse) ProtoMessage() {} + +func (x *StatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. +func (*StatusResponse) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{1} +} + +func (x *StatusResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *StatusResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +// Полная модель пользователя +type UserData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` // Полный путь в AD (Distinguished Name) + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // Логин (sAMAccountName) + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // ФИО (displayName) + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Почта (mail) + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // Описание/Должность (description) + Avatar []byte `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // Аватарка в байтах (thumbnailPhoto) + Groups []string `protobuf:"bytes,7,rep,name=groups,proto3" json:"groups,omitempty"` // Список групп + IsActive bool `protobuf:"varint,8,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` // Статус аккаунта + Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserData) Reset() { + *x = UserData{} + mi := &file_sso_ldap_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserData) ProtoMessage() {} + +func (x *UserData) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserData.ProtoReflect.Descriptor instead. +func (*UserData) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{2} +} + +func (x *UserData) GetDn() string { + if x != nil { + return x.Dn + } + return "" +} + +func (x *UserData) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UserData) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *UserData) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *UserData) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UserData) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *UserData) GetGroups() []string { + if x != nil { + return x.Groups + } + return nil +} + +func (x *UserData) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *UserData) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +// Модель группы +type GroupData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Короткое имя группы (cn) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupData) Reset() { + *x = GroupData{} + mi := &file_sso_ldap_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupData) ProtoMessage() {} + +func (x *GroupData) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupData.ProtoReflect.Descriptor instead. +func (*GroupData) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{3} +} + +func (x *GroupData) GetDn() string { + if x != nil { + return x.Dn + } + return "" +} + +func (x *GroupData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// --- Списки --- +type UserListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + Users []*UserData `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserListResponse) Reset() { + *x = UserListResponse{} + mi := &file_sso_ldap_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserListResponse) ProtoMessage() {} + +func (x *UserListResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserListResponse.ProtoReflect.Descriptor instead. +func (*UserListResponse) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{4} +} + +func (x *UserListResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *UserListResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *UserListResponse) GetUsers() []*UserData { + if x != nil { + return x.Users + } + return nil +} + +type GroupListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + Groups []*GroupData `protobuf:"bytes,3,rep,name=groups,proto3" json:"groups,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupListResponse) Reset() { + *x = GroupListResponse{} + mi := &file_sso_ldap_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupListResponse) ProtoMessage() {} + +func (x *GroupListResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupListResponse.ProtoReflect.Descriptor instead. +func (*GroupListResponse) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{5} +} + +func (x *GroupListResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *GroupListResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *GroupListResponse) GetGroups() []*GroupData { + if x != nil { + return x.Groups + } + return nil +} + +// --- Управление профилем --- +type CreateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` // Сразу при создании можно задать почту + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + mi := &file_sso_ldap_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CreateUserRequest) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *CreateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *CreateUserRequest) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +// Запрос на обновление. Используем optional для частичного обновления. +type UpdateUserRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // Обязательное поле: кого обновляем + DisplayName *string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3,oneof" json:"display_name,omitempty"` // Новое ФИО (повлечет Rename CN) + Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` // Новая почта + Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` // Новое описание + Avatar []byte `protobuf:"bytes,5,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"` // Новая аватарка (бинарник картинки) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + mi := &file_sso_ldap_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UpdateUserRequest) GetDisplayName() string { + if x != nil && x.DisplayName != nil { + return *x.DisplayName + } + return "" +} + +func (x *UpdateUserRequest) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *UpdateUserRequest) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *UpdateUserRequest) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +type ChangePasswordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + NewPassword string `protobuf:"bytes,2,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChangePasswordRequest) Reset() { + *x = ChangePasswordRequest{} + mi := &file_sso_ldap_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChangePasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangePasswordRequest) ProtoMessage() {} + +func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. +func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{8} +} + +func (x *ChangePasswordRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ChangePasswordRequest) GetNewPassword() string { + if x != nil { + return x.NewPassword + } + return "" +} + +type ToggleStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + SetActive bool `protobuf:"varint,2,opt,name=set_active,json=setActive,proto3" json:"set_active,omitempty"` // true - включить (512), false - отключить (514) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ToggleStatusRequest) Reset() { + *x = ToggleStatusRequest{} + mi := &file_sso_ldap_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ToggleStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ToggleStatusRequest) ProtoMessage() {} + +func (x *ToggleStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ToggleStatusRequest.ProtoReflect.Descriptor instead. +func (*ToggleStatusRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{9} +} + +func (x *ToggleStatusRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ToggleStatusRequest) GetSetActive() bool { + if x != nil { + return x.SetActive + } + return false +} + +// --- Управление членством в группах --- +type GroupMemberRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // Логин пользователя + GroupDn string `protobuf:"bytes,2,opt,name=group_dn,json=groupDn,proto3" json:"group_dn,omitempty"` // Полный путь группы (в которую добавляем / из которой удаляем) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupMemberRequest) Reset() { + *x = GroupMemberRequest{} + mi := &file_sso_ldap_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupMemberRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMemberRequest) ProtoMessage() {} + +func (x *GroupMemberRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_ldap_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMemberRequest.ProtoReflect.Descriptor instead. +func (*GroupMemberRequest) Descriptor() ([]byte, []int) { + return file_sso_ldap_proto_rawDescGZIP(), []int{10} +} + +func (x *GroupMemberRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GroupMemberRequest) GetGroupDn() string { + if x != nil { + return x.GroupDn + } + return "" +} + +var File_sso_ldap_proto protoreflect.FileDescriptor + +const file_sso_ldap_proto_rawDesc = "" + + "\n" + + "\x0esso/ldap.proto\x12\aldap.v1\"\x0e\n" + + "\fEmptyRequest\"O\n" + + "\x0eStatusResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xf4\x01\n" + + "\bUserData\x12\x0e\n" + + "\x02dn\x18\x01 \x01(\tR\x02dn\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12!\n" + + "\fdisplay_name\x18\x03 \x01(\tR\vdisplayName\x12\x14\n" + + "\x05email\x18\x04 \x01(\tR\x05email\x12 \n" + + "\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" + + "\x06avatar\x18\x06 \x01(\fR\x06avatar\x12\x16\n" + + "\x06groups\x18\a \x03(\tR\x06groups\x12\x1b\n" + + "\tis_active\x18\b \x01(\bR\bisActive\x12\x14\n" + + "\x05phone\x18\t \x01(\tR\x05phone\"/\n" + + "\tGroupData\x12\x0e\n" + + "\x02dn\x18\x01 \x01(\tR\x02dn\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"z\n" + + "\x10UserListResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12'\n" + + "\x05users\x18\x03 \x03(\v2\x11.ldap.v1.UserDataR\x05users\"~\n" + + "\x11GroupListResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + + "\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12*\n" + + "\x06groups\x18\x03 \x03(\v2\x12.ldap.v1.GroupDataR\x06groups\"\x8d\x01\n" + + "\x11CreateUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" + + "\tfull_name\x18\x02 \x01(\tR\bfullName\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x19\n" + + "\x05email\x18\x04 \x01(\tH\x00R\x05email\x88\x01\x01B\b\n" + + "\x06_email\"\xec\x01\n" + + "\x11UpdateUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12&\n" + + "\fdisplay_name\x18\x02 \x01(\tH\x00R\vdisplayName\x88\x01\x01\x12\x19\n" + + "\x05email\x18\x03 \x01(\tH\x01R\x05email\x88\x01\x01\x12%\n" + + "\vdescription\x18\x04 \x01(\tH\x02R\vdescription\x88\x01\x01\x12\x1b\n" + + "\x06avatar\x18\x05 \x01(\fH\x03R\x06avatar\x88\x01\x01B\x0f\n" + + "\r_display_nameB\b\n" + + "\x06_emailB\x0e\n" + + "\f_descriptionB\t\n" + + "\a_avatar\"V\n" + + "\x15ChangePasswordRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12!\n" + + "\fnew_password\x18\x02 \x01(\tR\vnewPassword\"P\n" + + "\x13ToggleStatusRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1d\n" + + "\n" + + "set_active\x18\x02 \x01(\bR\tsetActive\"K\n" + + "\x12GroupMemberRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x19\n" + + "\bgroup_dn\x18\x02 \x01(\tR\agroupDn2\xbc\x04\n" + + "\vLdapService\x12<\n" + + "\bGetUsers\x12\x15.ldap.v1.EmptyRequest\x1a\x19.ldap.v1.UserListResponse\x12A\n" + + "\n" + + "CreateUser\x12\x1a.ldap.v1.CreateUserRequest\x1a\x17.ldap.v1.StatusResponse\x12A\n" + + "\n" + + "UpdateUser\x12\x1a.ldap.v1.UpdateUserRequest\x1a\x17.ldap.v1.StatusResponse\x12I\n" + + "\x0eChangePassword\x12\x1e.ldap.v1.ChangePasswordRequest\x1a\x17.ldap.v1.StatusResponse\x12I\n" + + "\x10ToggleUserStatus\x12\x1c.ldap.v1.ToggleStatusRequest\x1a\x17.ldap.v1.StatusResponse\x12>\n" + + "\tGetGroups\x12\x15.ldap.v1.EmptyRequest\x1a\x1a.ldap.v1.GroupListResponse\x12F\n" + + "\x0eAddUserToGroup\x12\x1b.ldap.v1.GroupMemberRequest\x1a\x17.ldap.v1.StatusResponse\x12K\n" + + "\x13RemoveUserFromGroup\x12\x1b.ldap.v1.GroupMemberRequest\x1a\x17.ldap.v1.StatusResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_ldap_proto_rawDescOnce sync.Once + file_sso_ldap_proto_rawDescData []byte +) + +func file_sso_ldap_proto_rawDescGZIP() []byte { + file_sso_ldap_proto_rawDescOnce.Do(func() { + file_sso_ldap_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_ldap_proto_rawDesc), len(file_sso_ldap_proto_rawDesc))) + }) + return file_sso_ldap_proto_rawDescData +} + +var file_sso_ldap_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_sso_ldap_proto_goTypes = []any{ + (*EmptyRequest)(nil), // 0: ldap.v1.EmptyRequest + (*StatusResponse)(nil), // 1: ldap.v1.StatusResponse + (*UserData)(nil), // 2: ldap.v1.UserData + (*GroupData)(nil), // 3: ldap.v1.GroupData + (*UserListResponse)(nil), // 4: ldap.v1.UserListResponse + (*GroupListResponse)(nil), // 5: ldap.v1.GroupListResponse + (*CreateUserRequest)(nil), // 6: ldap.v1.CreateUserRequest + (*UpdateUserRequest)(nil), // 7: ldap.v1.UpdateUserRequest + (*ChangePasswordRequest)(nil), // 8: ldap.v1.ChangePasswordRequest + (*ToggleStatusRequest)(nil), // 9: ldap.v1.ToggleStatusRequest + (*GroupMemberRequest)(nil), // 10: ldap.v1.GroupMemberRequest +} +var file_sso_ldap_proto_depIdxs = []int32{ + 2, // 0: ldap.v1.UserListResponse.users:type_name -> ldap.v1.UserData + 3, // 1: ldap.v1.GroupListResponse.groups:type_name -> ldap.v1.GroupData + 0, // 2: ldap.v1.LdapService.GetUsers:input_type -> ldap.v1.EmptyRequest + 6, // 3: ldap.v1.LdapService.CreateUser:input_type -> ldap.v1.CreateUserRequest + 7, // 4: ldap.v1.LdapService.UpdateUser:input_type -> ldap.v1.UpdateUserRequest + 8, // 5: ldap.v1.LdapService.ChangePassword:input_type -> ldap.v1.ChangePasswordRequest + 9, // 6: ldap.v1.LdapService.ToggleUserStatus:input_type -> ldap.v1.ToggleStatusRequest + 0, // 7: ldap.v1.LdapService.GetGroups:input_type -> ldap.v1.EmptyRequest + 10, // 8: ldap.v1.LdapService.AddUserToGroup:input_type -> ldap.v1.GroupMemberRequest + 10, // 9: ldap.v1.LdapService.RemoveUserFromGroup:input_type -> ldap.v1.GroupMemberRequest + 4, // 10: ldap.v1.LdapService.GetUsers:output_type -> ldap.v1.UserListResponse + 1, // 11: ldap.v1.LdapService.CreateUser:output_type -> ldap.v1.StatusResponse + 1, // 12: ldap.v1.LdapService.UpdateUser:output_type -> ldap.v1.StatusResponse + 1, // 13: ldap.v1.LdapService.ChangePassword:output_type -> ldap.v1.StatusResponse + 1, // 14: ldap.v1.LdapService.ToggleUserStatus:output_type -> ldap.v1.StatusResponse + 5, // 15: ldap.v1.LdapService.GetGroups:output_type -> ldap.v1.GroupListResponse + 1, // 16: ldap.v1.LdapService.AddUserToGroup:output_type -> ldap.v1.StatusResponse + 1, // 17: ldap.v1.LdapService.RemoveUserFromGroup:output_type -> ldap.v1.StatusResponse + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_sso_ldap_proto_init() } +func file_sso_ldap_proto_init() { + if File_sso_ldap_proto != nil { + return + } + file_sso_ldap_proto_msgTypes[6].OneofWrappers = []any{} + file_sso_ldap_proto_msgTypes[7].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_ldap_proto_rawDesc), len(file_sso_ldap_proto_rawDesc)), + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_ldap_proto_goTypes, + DependencyIndexes: file_sso_ldap_proto_depIdxs, + MessageInfos: file_sso_ldap_proto_msgTypes, + }.Build() + File_sso_ldap_proto = out.File + file_sso_ldap_proto_goTypes = nil + file_sso_ldap_proto_depIdxs = nil +} diff --git a/gen/go/sso/ldap_grpc.pb.go b/gen/go/sso/ldap_grpc.pb.go new file mode 100644 index 0000000..58004f3 --- /dev/null +++ b/gen/go/sso/ldap_grpc.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/ldap.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + LdapService_GetUsers_FullMethodName = "/ldap.v1.LdapService/GetUsers" + LdapService_CreateUser_FullMethodName = "/ldap.v1.LdapService/CreateUser" + LdapService_UpdateUser_FullMethodName = "/ldap.v1.LdapService/UpdateUser" + LdapService_ChangePassword_FullMethodName = "/ldap.v1.LdapService/ChangePassword" + LdapService_ToggleUserStatus_FullMethodName = "/ldap.v1.LdapService/ToggleUserStatus" + LdapService_GetGroups_FullMethodName = "/ldap.v1.LdapService/GetGroups" + LdapService_AddUserToGroup_FullMethodName = "/ldap.v1.LdapService/AddUserToGroup" + LdapService_RemoveUserFromGroup_FullMethodName = "/ldap.v1.LdapService/RemoveUserFromGroup" +) + +// LdapServiceClient is the client API for LdapService 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 LdapServiceClient interface { + // Управление Пользователями (Bind системного аккаунта) --- + GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) + ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error) + ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) + // Управление Группами --- + GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error) + AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) + RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) +} + +type ldapServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLdapServiceClient(cc grpc.ClientConnInterface) LdapServiceClient { + return &ldapServiceClient{cc} +} + +func (c *ldapServiceClient) GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserListResponse) + err := c.cc.Invoke(ctx, LdapService_GetUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_CreateUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_UpdateUser_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_ChangePassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_ToggleUserStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GroupListResponse) + err := c.cc.Invoke(ctx, LdapService_GetGroups_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_AddUserToGroup_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ldapServiceClient) RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, LdapService_RemoveUserFromGroup_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LdapServiceServer is the server API for LdapService service. +// All implementations must embed UnimplementedLdapServiceServer +// for forward compatibility. +type LdapServiceServer interface { + // Управление Пользователями (Bind системного аккаунта) --- + GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) + CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) + UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error) + ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error) + ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error) + // Управление Группами --- + GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error) + AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) + RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) + mustEmbedUnimplementedLdapServiceServer() +} + +// UnimplementedLdapServiceServer must 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 UnimplementedLdapServiceServer struct{} + +func (UnimplementedLdapServiceServer) GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented") +} +func (UnimplementedLdapServiceServer) CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedLdapServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedLdapServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ChangePassword not implemented") +} +func (UnimplementedLdapServiceServer) ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ToggleUserStatus not implemented") +} +func (UnimplementedLdapServiceServer) GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetGroups not implemented") +} +func (UnimplementedLdapServiceServer) AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method AddUserToGroup not implemented") +} +func (UnimplementedLdapServiceServer) RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RemoveUserFromGroup not implemented") +} +func (UnimplementedLdapServiceServer) mustEmbedUnimplementedLdapServiceServer() {} +func (UnimplementedLdapServiceServer) testEmbeddedByValue() {} + +// UnsafeLdapServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LdapServiceServer will +// result in compilation errors. +type UnsafeLdapServiceServer interface { + mustEmbedUnimplementedLdapServiceServer() +} + +func RegisterLdapServiceServer(s grpc.ServiceRegistrar, srv LdapServiceServer) { + // If the following call panics, it indicates UnimplementedLdapServiceServer 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(&LdapService_ServiceDesc, srv) +} + +func _LdapService_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).GetUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_GetUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).GetUsers(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChangePasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).ChangePassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_ChangePassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_ToggleUserStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ToggleStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).ToggleUserStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_ToggleUserStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).ToggleUserStatus(ctx, req.(*ToggleStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).GetGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_GetGroups_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).GetGroups(ctx, req.(*EmptyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_AddUserToGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupMemberRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).AddUserToGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_AddUserToGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).AddUserToGroup(ctx, req.(*GroupMemberRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LdapService_RemoveUserFromGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupMemberRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LdapServiceServer).RemoveUserFromGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LdapService_RemoveUserFromGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LdapServiceServer).RemoveUserFromGroup(ctx, req.(*GroupMemberRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LdapService_ServiceDesc is the grpc.ServiceDesc for LdapService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LdapService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ldap.v1.LdapService", + HandlerType: (*LdapServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUsers", + Handler: _LdapService_GetUsers_Handler, + }, + { + MethodName: "CreateUser", + Handler: _LdapService_CreateUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _LdapService_UpdateUser_Handler, + }, + { + MethodName: "ChangePassword", + Handler: _LdapService_ChangePassword_Handler, + }, + { + MethodName: "ToggleUserStatus", + Handler: _LdapService_ToggleUserStatus_Handler, + }, + { + MethodName: "GetGroups", + Handler: _LdapService_GetGroups_Handler, + }, + { + MethodName: "AddUserToGroup", + Handler: _LdapService_AddUserToGroup_Handler, + }, + { + MethodName: "RemoveUserFromGroup", + Handler: _LdapService_RemoveUserFromGroup_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/ldap.proto", +} diff --git a/gen/go/sso/rbac.pb.go b/gen/go/sso/rbac.pb.go new file mode 100644 index 0000000..079b693 --- /dev/null +++ b/gen/go/sso/rbac.pb.go @@ -0,0 +1,975 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/rbac.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 GetAllPermissionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllPermissionsRequest) Reset() { + *x = GetAllPermissionsRequest{} + mi := &file_sso_rbac_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllPermissionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllPermissionsRequest) ProtoMessage() {} + +func (x *GetAllPermissionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllPermissionsRequest.ProtoReflect.Descriptor instead. +func (*GetAllPermissionsRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAllPermissionsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetAllPermissionsRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type GetAllPermissionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllPermissionsResponse) Reset() { + *x = GetAllPermissionsResponse{} + mi := &file_sso_rbac_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllPermissionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllPermissionsResponse) ProtoMessage() {} + +func (x *GetAllPermissionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllPermissionsResponse.ProtoReflect.Descriptor instead. +func (*GetAllPermissionsResponse) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAllPermissionsResponse) GetPermissions() []*Permission { + if x != nil { + return x.Permissions + } + return nil +} + +type Permission struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Module string `protobuf:"bytes,4,opt,name=module,proto3" json:"module,omitempty"` + Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Permission) Reset() { + *x = Permission{} + mi := &file_sso_rbac_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Permission) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Permission) ProtoMessage() {} + +func (x *Permission) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Permission.ProtoReflect.Descriptor instead. +func (*Permission) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{2} +} + +func (x *Permission) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Permission) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *Permission) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Permission) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *Permission) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +type GetAllRolesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllRolesRequest) Reset() { + *x = GetAllRolesRequest{} + mi := &file_sso_rbac_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllRolesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllRolesRequest) ProtoMessage() {} + +func (x *GetAllRolesRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllRolesRequest.ProtoReflect.Descriptor instead. +func (*GetAllRolesRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{3} +} + +func (x *GetAllRolesRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetAllRolesRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type GetAllRolesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Roles []*Roles `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllRolesResponse) Reset() { + *x = GetAllRolesResponse{} + mi := &file_sso_rbac_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllRolesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllRolesResponse) ProtoMessage() {} + +func (x *GetAllRolesResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllRolesResponse.ProtoReflect.Descriptor instead. +func (*GetAllRolesResponse) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAllRolesResponse) GetRoles() []*Roles { + if x != nil { + return x.Roles + } + return nil +} + +type CreateRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` + PermissionCodes []string `protobuf:"bytes,3,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRoleRequest) Reset() { + *x = CreateRoleRequest{} + mi := &file_sso_rbac_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRoleRequest) ProtoMessage() {} + +func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRoleRequest.ProtoReflect.Descriptor instead. +func (*CreateRoleRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateRoleRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateRoleRequest) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *CreateRoleRequest) GetPermissionCodes() []string { + if x != nil { + return x.PermissionCodes + } + return nil +} + +type UpdateRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + Level *int32 `protobuf:"varint,3,opt,name=level,proto3,oneof" json:"level,omitempty"` + PermissionCodes []string `protobuf:"bytes,4,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateRoleRequest) Reset() { + *x = UpdateRoleRequest{} + mi := &file_sso_rbac_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRoleRequest) ProtoMessage() {} + +func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRoleRequest.ProtoReflect.Descriptor instead. +func (*UpdateRoleRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateRoleRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateRoleRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *UpdateRoleRequest) GetLevel() int32 { + if x != nil && x.Level != nil { + return *x.Level + } + return 0 +} + +func (x *UpdateRoleRequest) GetPermissionCodes() []string { + if x != nil { + return x.PermissionCodes + } + return nil +} + +type ModifyRoleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ModifyRoleResponse) Reset() { + *x = ModifyRoleResponse{} + mi := &file_sso_rbac_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ModifyRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyRoleResponse) ProtoMessage() {} + +func (x *ModifyRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModifyRoleResponse.ProtoReflect.Descriptor instead. +func (*ModifyRoleResponse) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{7} +} + +func (x *ModifyRoleResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ModifyRoleResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeleteRoleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRoleRequest) Reset() { + *x = DeleteRoleRequest{} + mi := &file_sso_rbac_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRoleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRoleRequest) ProtoMessage() {} + +func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRoleRequest.ProtoReflect.Descriptor instead. +func (*DeleteRoleRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteRoleRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteRoleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + FallbackRoleName *string `protobuf:"bytes,3,opt,name=fallback_role_name,json=fallbackRoleName,proto3,oneof" json:"fallback_role_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRoleResponse) Reset() { + *x = DeleteRoleResponse{} + mi := &file_sso_rbac_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRoleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRoleResponse) ProtoMessage() {} + +func (x *DeleteRoleResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRoleResponse.ProtoReflect.Descriptor instead. +func (*DeleteRoleResponse) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteRoleResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeleteRoleResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *DeleteRoleResponse) GetFallbackRoleName() string { + if x != nil && x.FallbackRoleName != nil { + return *x.FallbackRoleName + } + return "" +} + +type CreatePermissionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Module string `protobuf:"bytes,3,opt,name=module,proto3" json:"module,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreatePermissionRequest) Reset() { + *x = CreatePermissionRequest{} + mi := &file_sso_rbac_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePermissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePermissionRequest) ProtoMessage() {} + +func (x *CreatePermissionRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePermissionRequest.ProtoReflect.Descriptor instead. +func (*CreatePermissionRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{10} +} + +func (x *CreatePermissionRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *CreatePermissionRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreatePermissionRequest) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +type UpdatePermissionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + RoleIds []string `protobuf:"bytes,2,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` // Привязка к конкретным ролям + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdatePermissionRequest) Reset() { + *x = UpdatePermissionRequest{} + mi := &file_sso_rbac_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdatePermissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePermissionRequest) ProtoMessage() {} + +func (x *UpdatePermissionRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePermissionRequest.ProtoReflect.Descriptor instead. +func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{11} +} + +func (x *UpdatePermissionRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdatePermissionRequest) GetRoleIds() []string { + if x != nil { + return x.RoleIds + } + return nil +} + +type ModifyPermissionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ModifyPermissionResponse) Reset() { + *x = ModifyPermissionResponse{} + mi := &file_sso_rbac_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ModifyPermissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyPermissionResponse) ProtoMessage() {} + +func (x *ModifyPermissionResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModifyPermissionResponse.ProtoReflect.Descriptor instead. +func (*ModifyPermissionResponse) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{12} +} + +func (x *ModifyPermissionResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ModifyPermissionResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type Roles struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` + Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"` + LdapMapping []string `protobuf:"bytes,5,rep,name=ldap_mapping,json=ldapMapping,proto3" json:"ldap_mapping,omitempty"` + Accounts []string `protobuf:"bytes,6,rep,name=accounts,proto3" json:"accounts,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Roles) Reset() { + *x = Roles{} + mi := &file_sso_rbac_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Roles) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Roles) ProtoMessage() {} + +func (x *Roles) ProtoReflect() protoreflect.Message { + mi := &file_sso_rbac_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Roles.ProtoReflect.Descriptor instead. +func (*Roles) Descriptor() ([]byte, []int) { + return file_sso_rbac_proto_rawDescGZIP(), []int{13} +} + +func (x *Roles) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Roles) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Roles) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *Roles) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *Roles) GetLdapMapping() []string { + if x != nil { + return x.LdapMapping + } + return nil +} + +func (x *Roles) GetAccounts() []string { + if x != nil { + return x.Accounts + } + return nil +} + +var File_sso_rbac_proto protoreflect.FileDescriptor + +const file_sso_rbac_proto_rawDesc = "" + + "\n" + + "\x0esso/rbac.proto\x12\arbac.v1\"R\n" + + "\x18GetAllPermissionsRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"R\n" + + "\x19GetAllPermissionsResponse\x125\n" + + "\vpermissions\x18\x01 \x03(\v2\x13.rbac.v1.PermissionR\vpermissions\"\x80\x01\n" + + "\n" + + "Permission\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04code\x18\x02 \x01(\tR\x04code\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" + + "\x06module\x18\x04 \x01(\tR\x06module\x12\x14\n" + + "\x05roles\x18\x05 \x03(\tR\x05roles\"L\n" + + "\x12GetAllRolesRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\";\n" + + "\x13GetAllRolesResponse\x12$\n" + + "\x05roles\x18\x01 \x03(\v2\x0e.rbac.v1.RolesR\x05roles\"h\n" + + "\x11CreateRoleRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05level\x18\x02 \x01(\x05R\x05level\x12)\n" + + "\x10permission_codes\x18\x03 \x03(\tR\x0fpermissionCodes\"\x95\x01\n" + + "\x11UpdateRoleRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" + + "\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12\x19\n" + + "\x05level\x18\x03 \x01(\x05H\x01R\x05level\x88\x01\x01\x12)\n" + + "\x10permission_codes\x18\x04 \x03(\tR\x0fpermissionCodesB\a\n" + + "\x05_nameB\b\n" + + "\x06_level\"H\n" + + "\x12ModifyRoleResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"#\n" + + "\x11DeleteRoleRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x92\x01\n" + + "\x12DeleteRoleResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x121\n" + + "\x12fallback_role_name\x18\x03 \x01(\tH\x00R\x10fallbackRoleName\x88\x01\x01B\x15\n" + + "\x13_fallback_role_name\"g\n" + + "\x17CreatePermissionRequest\x12\x12\n" + + "\x04code\x18\x01 \x01(\tR\x04code\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" + + "\x06module\x18\x03 \x01(\tR\x06module\"D\n" + + "\x17UpdatePermissionRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" + + "\brole_ids\x18\x02 \x03(\tR\aroleIds\"N\n" + + "\x18ModifyPermissionResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\xa2\x01\n" + + "\x05Roles\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" + + "\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" + + "\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" + + "\baccounts\x18\x06 \x03(\tR\baccounts2\xba\x04\n" + + "\vRbacService\x12E\n" + + "\n" + + "CreateRole\x12\x1a.rbac.v1.CreateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" + + "\n" + + "UpdateRole\x12\x1a.rbac.v1.UpdateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" + + "\n" + + "DeleteRole\x12\x1a.rbac.v1.DeleteRoleRequest\x1a\x1b.rbac.v1.DeleteRoleResponse\x12W\n" + + "\x10CreatePermission\x12 .rbac.v1.CreatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12W\n" + + "\x10UpdatePermission\x12 .rbac.v1.UpdatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12Z\n" + + "\x11GetAllPermissions\x12!.rbac.v1.GetAllPermissionsRequest\x1a\".rbac.v1.GetAllPermissionsResponse\x12H\n" + + "\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_rbac_proto_rawDescOnce sync.Once + file_sso_rbac_proto_rawDescData []byte +) + +func file_sso_rbac_proto_rawDescGZIP() []byte { + file_sso_rbac_proto_rawDescOnce.Do(func() { + file_sso_rbac_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_rbac_proto_rawDesc), len(file_sso_rbac_proto_rawDesc))) + }) + return file_sso_rbac_proto_rawDescData +} + +var file_sso_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_sso_rbac_proto_goTypes = []any{ + (*GetAllPermissionsRequest)(nil), // 0: rbac.v1.GetAllPermissionsRequest + (*GetAllPermissionsResponse)(nil), // 1: rbac.v1.GetAllPermissionsResponse + (*Permission)(nil), // 2: rbac.v1.Permission + (*GetAllRolesRequest)(nil), // 3: rbac.v1.GetAllRolesRequest + (*GetAllRolesResponse)(nil), // 4: rbac.v1.GetAllRolesResponse + (*CreateRoleRequest)(nil), // 5: rbac.v1.CreateRoleRequest + (*UpdateRoleRequest)(nil), // 6: rbac.v1.UpdateRoleRequest + (*ModifyRoleResponse)(nil), // 7: rbac.v1.ModifyRoleResponse + (*DeleteRoleRequest)(nil), // 8: rbac.v1.DeleteRoleRequest + (*DeleteRoleResponse)(nil), // 9: rbac.v1.DeleteRoleResponse + (*CreatePermissionRequest)(nil), // 10: rbac.v1.CreatePermissionRequest + (*UpdatePermissionRequest)(nil), // 11: rbac.v1.UpdatePermissionRequest + (*ModifyPermissionResponse)(nil), // 12: rbac.v1.ModifyPermissionResponse + (*Roles)(nil), // 13: rbac.v1.Roles +} +var file_sso_rbac_proto_depIdxs = []int32{ + 2, // 0: rbac.v1.GetAllPermissionsResponse.permissions:type_name -> rbac.v1.Permission + 13, // 1: rbac.v1.GetAllRolesResponse.roles:type_name -> rbac.v1.Roles + 5, // 2: rbac.v1.RbacService.CreateRole:input_type -> rbac.v1.CreateRoleRequest + 6, // 3: rbac.v1.RbacService.UpdateRole:input_type -> rbac.v1.UpdateRoleRequest + 8, // 4: rbac.v1.RbacService.DeleteRole:input_type -> rbac.v1.DeleteRoleRequest + 10, // 5: rbac.v1.RbacService.CreatePermission:input_type -> rbac.v1.CreatePermissionRequest + 11, // 6: rbac.v1.RbacService.UpdatePermission:input_type -> rbac.v1.UpdatePermissionRequest + 0, // 7: rbac.v1.RbacService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest + 3, // 8: rbac.v1.RbacService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest + 7, // 9: rbac.v1.RbacService.CreateRole:output_type -> rbac.v1.ModifyRoleResponse + 7, // 10: rbac.v1.RbacService.UpdateRole:output_type -> rbac.v1.ModifyRoleResponse + 9, // 11: rbac.v1.RbacService.DeleteRole:output_type -> rbac.v1.DeleteRoleResponse + 12, // 12: rbac.v1.RbacService.CreatePermission:output_type -> rbac.v1.ModifyPermissionResponse + 12, // 13: rbac.v1.RbacService.UpdatePermission:output_type -> rbac.v1.ModifyPermissionResponse + 1, // 14: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse + 4, // 15: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse + 9, // [9:16] is the sub-list for method output_type + 2, // [2:9] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_sso_rbac_proto_init() } +func file_sso_rbac_proto_init() { + if File_sso_rbac_proto != nil { + return + } + file_sso_rbac_proto_msgTypes[6].OneofWrappers = []any{} + file_sso_rbac_proto_msgTypes[9].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_rbac_proto_rawDesc), len(file_sso_rbac_proto_rawDesc)), + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_rbac_proto_goTypes, + DependencyIndexes: file_sso_rbac_proto_depIdxs, + MessageInfos: file_sso_rbac_proto_msgTypes, + }.Build() + File_sso_rbac_proto = out.File + file_sso_rbac_proto_goTypes = nil + file_sso_rbac_proto_depIdxs = nil +} diff --git a/gen/go/sso/rbac_grpc.pb.go b/gen/go/sso/rbac_grpc.pb.go new file mode 100644 index 0000000..5140d27 --- /dev/null +++ b/gen/go/sso/rbac_grpc.pb.go @@ -0,0 +1,349 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/rbac.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + RbacService_CreateRole_FullMethodName = "/rbac.v1.RbacService/CreateRole" + RbacService_UpdateRole_FullMethodName = "/rbac.v1.RbacService/UpdateRole" + RbacService_DeleteRole_FullMethodName = "/rbac.v1.RbacService/DeleteRole" + RbacService_CreatePermission_FullMethodName = "/rbac.v1.RbacService/CreatePermission" + RbacService_UpdatePermission_FullMethodName = "/rbac.v1.RbacService/UpdatePermission" + RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions" + RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles" +) + +// RbacServiceClient is the client API for RbacService 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 RbacServiceClient interface { + CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) + UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) + DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) + CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) + UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) + GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) + GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) +} + +type rbacServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRbacServiceClient(cc grpc.ClientConnInterface) RbacServiceClient { + return &rbacServiceClient{cc} +} + +func (c *rbacServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyRoleResponse) + err := c.cc.Invoke(ctx, RbacService_CreateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyRoleResponse) + err := c.cc.Invoke(ctx, RbacService_UpdateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteRoleResponse) + err := c.cc.Invoke(ctx, RbacService_DeleteRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyPermissionResponse) + err := c.cc.Invoke(ctx, RbacService_CreatePermission_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyPermissionResponse) + err := c.cc.Invoke(ctx, RbacService_UpdatePermission_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAllPermissionsResponse) + err := c.cc.Invoke(ctx, RbacService_GetAllPermissions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *rbacServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAllRolesResponse) + err := c.cc.Invoke(ctx, RbacService_GetAllRoles_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RbacServiceServer is the server API for RbacService service. +// All implementations must embed UnimplementedRbacServiceServer +// for forward compatibility. +type RbacServiceServer interface { + CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error) + UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error) + DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) + CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error) + UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error) + GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) + GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) + mustEmbedUnimplementedRbacServiceServer() +} + +// UnimplementedRbacServiceServer must 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 UnimplementedRbacServiceServer struct{} + +func (UnimplementedRbacServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented") +} +func (UnimplementedRbacServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented") +} +func (UnimplementedRbacServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented") +} +func (UnimplementedRbacServiceServer) CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreatePermission not implemented") +} +func (UnimplementedRbacServiceServer) UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdatePermission not implemented") +} +func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented") +} +func (UnimplementedRbacServiceServer) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented") +} +func (UnimplementedRbacServiceServer) mustEmbedUnimplementedRbacServiceServer() {} +func (UnimplementedRbacServiceServer) testEmbeddedByValue() {} + +// UnsafeRbacServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RbacServiceServer will +// result in compilation errors. +type UnsafeRbacServiceServer interface { + mustEmbedUnimplementedRbacServiceServer() +} + +func RegisterRbacServiceServer(s grpc.ServiceRegistrar, srv RbacServiceServer) { + // If the following call panics, it indicates UnimplementedRbacServiceServer 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(&RbacService_ServiceDesc, srv) +} + +func _RbacService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_CreateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).CreateRole(ctx, req.(*CreateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_UpdateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).UpdateRole(ctx, req.(*UpdateRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRoleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_DeleteRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).DeleteRole(ctx, req.(*DeleteRoleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_CreatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).CreatePermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_CreatePermission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).CreatePermission(ctx, req.(*CreatePermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePermissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).UpdatePermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_UpdatePermission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).UpdatePermission(ctx, req.(*UpdatePermissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).GetAllPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_GetAllPermissions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).GetAllPermissions(ctx, req.(*GetAllPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RbacService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllRolesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RbacServiceServer).GetAllRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RbacService_GetAllRoles_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RbacServiceServer).GetAllRoles(ctx, req.(*GetAllRolesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RbacService_ServiceDesc is the grpc.ServiceDesc for RbacService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RbacService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rbac.v1.RbacService", + HandlerType: (*RbacServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRole", + Handler: _RbacService_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _RbacService_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _RbacService_DeleteRole_Handler, + }, + { + MethodName: "CreatePermission", + Handler: _RbacService_CreatePermission_Handler, + }, + { + MethodName: "UpdatePermission", + Handler: _RbacService_UpdatePermission_Handler, + }, + { + MethodName: "GetAllPermissions", + Handler: _RbacService_GetAllPermissions_Handler, + }, + { + MethodName: "GetAllRoles", + Handler: _RbacService_GetAllRoles_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/rbac.proto", +} diff --git a/gen/go/sso/twofa.pb.go b/gen/go/sso/twofa.pb.go new file mode 100644 index 0000000..59ba557 --- /dev/null +++ b/gen/go/sso/twofa.pb.go @@ -0,0 +1,1118 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v3.21.12 +// source: sso/twofa.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 Verify2FaRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TempToken string `protobuf:"bytes,1,opt,name=temp_token,json=tempToken,proto3" json:"temp_token,omitempty"` + TotpCode *string `protobuf:"bytes,2,opt,name=totp_code,json=totpCode,proto3,oneof" json:"totp_code,omitempty"` + TelegramCode *string `protobuf:"bytes,3,opt,name=telegram_code,json=telegramCode,proto3,oneof" json:"telegram_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Verify2FaRequest) Reset() { + *x = Verify2FaRequest{} + mi := &file_sso_twofa_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Verify2FaRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Verify2FaRequest) ProtoMessage() {} + +func (x *Verify2FaRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Verify2FaRequest.ProtoReflect.Descriptor instead. +func (*Verify2FaRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{0} +} + +func (x *Verify2FaRequest) GetTempToken() string { + if x != nil { + return x.TempToken + } + return "" +} + +func (x *Verify2FaRequest) GetTotpCode() string { + if x != nil && x.TotpCode != nil { + return *x.TotpCode + } + return "" +} + +func (x *Verify2FaRequest) GetTelegramCode() string { + if x != nil && x.TelegramCode != nil { + return *x.TelegramCode + } + return "" +} + +type Verify2FaResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` + ReserveCodes []string `protobuf:"bytes,5,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Verify2FaResponse) Reset() { + *x = Verify2FaResponse{} + mi := &file_sso_twofa_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Verify2FaResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Verify2FaResponse) ProtoMessage() {} + +func (x *Verify2FaResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Verify2FaResponse.ProtoReflect.Descriptor instead. +func (*Verify2FaResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{1} +} + +func (x *Verify2FaResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *Verify2FaResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Verify2FaResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Verify2FaResponse) GetReserveCodes() []string { + if x != nil { + return x.ReserveCodes + } + return nil +} + +type AuthenticatedAccessRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AuthenticatedAccessRequest) Reset() { + *x = AuthenticatedAccessRequest{} + mi := &file_sso_twofa_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AuthenticatedAccessRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthenticatedAccessRequest) ProtoMessage() {} + +func (x *AuthenticatedAccessRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthenticatedAccessRequest.ProtoReflect.Descriptor instead. +func (*AuthenticatedAccessRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{2} +} + +func (x *AuthenticatedAccessRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +type GetTwoFaStatusRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTwoFaStatusRequest) Reset() { + *x = GetTwoFaStatusRequest{} + mi := &file_sso_twofa_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTwoFaStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTwoFaStatusRequest) ProtoMessage() {} + +func (x *GetTwoFaStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTwoFaStatusRequest.ProtoReflect.Descriptor instead. +func (*GetTwoFaStatusRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{3} +} + +func (x *GetTwoFaStatusRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +type GetTwoFaStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TotpEnabled bool `protobuf:"varint,1,opt,name=totp_enabled,json=totpEnabled,proto3" json:"totp_enabled,omitempty"` + TelegramEnabled bool `protobuf:"varint,2,opt,name=telegram_enabled,json=telegramEnabled,proto3" json:"telegram_enabled,omitempty"` + TotpEnrollmentPending bool `protobuf:"varint,3,opt,name=totp_enrollment_pending,json=totpEnrollmentPending,proto3" json:"totp_enrollment_pending,omitempty"` + TelegramEnrollmentPending bool `protobuf:"varint,4,opt,name=telegram_enrollment_pending,json=telegramEnrollmentPending,proto3" json:"telegram_enrollment_pending,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTwoFaStatusResponse) Reset() { + *x = GetTwoFaStatusResponse{} + mi := &file_sso_twofa_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTwoFaStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTwoFaStatusResponse) ProtoMessage() {} + +func (x *GetTwoFaStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTwoFaStatusResponse.ProtoReflect.Descriptor instead. +func (*GetTwoFaStatusResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{4} +} + +func (x *GetTwoFaStatusResponse) GetTotpEnabled() bool { + if x != nil { + return x.TotpEnabled + } + return false +} + +func (x *GetTwoFaStatusResponse) GetTelegramEnabled() bool { + if x != nil { + return x.TelegramEnabled + } + return false +} + +func (x *GetTwoFaStatusResponse) GetTotpEnrollmentPending() bool { + if x != nil { + return x.TotpEnrollmentPending + } + return false +} + +func (x *GetTwoFaStatusResponse) GetTelegramEnrollmentPending() bool { + if x != nil { + return x.TelegramEnrollmentPending + } + return false +} + +type StartTotpEnrollmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + SecretBase32 string `protobuf:"bytes,1,opt,name=secret_base32,json=secretBase32,proto3" json:"secret_base32,omitempty"` + OtpauthUri string `protobuf:"bytes,2,opt,name=otpauth_uri,json=otpauthUri,proto3" json:"otpauth_uri,omitempty"` + Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` + AccountLabel string `protobuf:"bytes,4,opt,name=account_label,json=accountLabel,proto3" json:"account_label,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StartTotpEnrollmentResponse) Reset() { + *x = StartTotpEnrollmentResponse{} + mi := &file_sso_twofa_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StartTotpEnrollmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartTotpEnrollmentResponse) ProtoMessage() {} + +func (x *StartTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartTotpEnrollmentResponse.ProtoReflect.Descriptor instead. +func (*StartTotpEnrollmentResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{5} +} + +func (x *StartTotpEnrollmentResponse) GetSecretBase32() string { + if x != nil { + return x.SecretBase32 + } + return "" +} + +func (x *StartTotpEnrollmentResponse) GetOtpauthUri() string { + if x != nil { + return x.OtpauthUri + } + return "" +} + +func (x *StartTotpEnrollmentResponse) GetIssuer() string { + if x != nil { + return x.Issuer + } + return "" +} + +func (x *StartTotpEnrollmentResponse) GetAccountLabel() string { + if x != nil { + return x.AccountLabel + } + return "" +} + +type ConfirmTotpEnrollmentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + TotpCode string `protobuf:"bytes,2,opt,name=totp_code,json=totpCode,proto3" json:"totp_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConfirmTotpEnrollmentRequest) Reset() { + *x = ConfirmTotpEnrollmentRequest{} + mi := &file_sso_twofa_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConfirmTotpEnrollmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmTotpEnrollmentRequest) ProtoMessage() {} + +func (x *ConfirmTotpEnrollmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmTotpEnrollmentRequest.ProtoReflect.Descriptor instead. +func (*ConfirmTotpEnrollmentRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{6} +} + +func (x *ConfirmTotpEnrollmentRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *ConfirmTotpEnrollmentRequest) GetTotpCode() string { + if x != nil { + return x.TotpCode + } + return "" +} + +type ConfirmTotpEnrollmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + ReserveCodes []string `protobuf:"bytes,3,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConfirmTotpEnrollmentResponse) Reset() { + *x = ConfirmTotpEnrollmentResponse{} + mi := &file_sso_twofa_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConfirmTotpEnrollmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmTotpEnrollmentResponse) ProtoMessage() {} + +func (x *ConfirmTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmTotpEnrollmentResponse.ProtoReflect.Descriptor instead. +func (*ConfirmTotpEnrollmentResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{7} +} + +func (x *ConfirmTotpEnrollmentResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ConfirmTotpEnrollmentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ConfirmTotpEnrollmentResponse) GetReserveCodes() []string { + if x != nil { + return x.ReserveCodes + } + return nil +} + +type CancelTotpEnrollmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CancelTotpEnrollmentResponse) Reset() { + *x = CancelTotpEnrollmentResponse{} + mi := &file_sso_twofa_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CancelTotpEnrollmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CancelTotpEnrollmentResponse) ProtoMessage() {} + +func (x *CancelTotpEnrollmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CancelTotpEnrollmentResponse.ProtoReflect.Descriptor instead. +func (*CancelTotpEnrollmentResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{8} +} + +func (x *CancelTotpEnrollmentResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *CancelTotpEnrollmentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DisableTotpRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + TotpCode *string `protobuf:"bytes,3,opt,name=totp_code,json=totpCode,proto3,oneof" json:"totp_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableTotpRequest) Reset() { + *x = DisableTotpRequest{} + mi := &file_sso_twofa_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableTotpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableTotpRequest) ProtoMessage() {} + +func (x *DisableTotpRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableTotpRequest.ProtoReflect.Descriptor instead. +func (*DisableTotpRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{9} +} + +func (x *DisableTotpRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *DisableTotpRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *DisableTotpRequest) GetTotpCode() string { + if x != nil && x.TotpCode != nil { + return *x.TotpCode + } + return "" +} + +type DisableTotpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableTotpResponse) Reset() { + *x = DisableTotpResponse{} + mi := &file_sso_twofa_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableTotpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableTotpResponse) ProtoMessage() {} + +func (x *DisableTotpResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableTotpResponse.ProtoReflect.Descriptor instead. +func (*DisableTotpResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{10} +} + +func (x *DisableTotpResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *DisableTotpResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type StartTelegramEnrollmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + EnrollmentToken string `protobuf:"bytes,1,opt,name=enrollment_token,json=enrollmentToken,proto3" json:"enrollment_token,omitempty"` + DeepLink string `protobuf:"bytes,2,opt,name=deep_link,json=deepLink,proto3" json:"deep_link,omitempty"` + BotUsername string `protobuf:"bytes,3,opt,name=bot_username,json=botUsername,proto3" json:"bot_username,omitempty"` + ExpiresAtIso string `protobuf:"bytes,4,opt,name=expires_at_iso,json=expiresAtIso,proto3" json:"expires_at_iso,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StartTelegramEnrollmentResponse) Reset() { + *x = StartTelegramEnrollmentResponse{} + mi := &file_sso_twofa_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StartTelegramEnrollmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartTelegramEnrollmentResponse) ProtoMessage() {} + +func (x *StartTelegramEnrollmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StartTelegramEnrollmentResponse.ProtoReflect.Descriptor instead. +func (*StartTelegramEnrollmentResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{11} +} + +func (x *StartTelegramEnrollmentResponse) GetEnrollmentToken() string { + if x != nil { + return x.EnrollmentToken + } + return "" +} + +func (x *StartTelegramEnrollmentResponse) GetDeepLink() string { + if x != nil { + return x.DeepLink + } + return "" +} + +func (x *StartTelegramEnrollmentResponse) GetBotUsername() string { + if x != nil { + return x.BotUsername + } + return "" +} + +func (x *StartTelegramEnrollmentResponse) GetExpiresAtIso() string { + if x != nil { + return x.ExpiresAtIso + } + return "" +} + +type ConfirmTelegramEnrollmentRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + EnrollmentToken string `protobuf:"bytes,2,opt,name=enrollment_token,json=enrollmentToken,proto3" json:"enrollment_token,omitempty"` + OtpCode string `protobuf:"bytes,3,opt,name=otp_code,json=otpCode,proto3" json:"otp_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConfirmTelegramEnrollmentRequest) Reset() { + *x = ConfirmTelegramEnrollmentRequest{} + mi := &file_sso_twofa_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConfirmTelegramEnrollmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmTelegramEnrollmentRequest) ProtoMessage() {} + +func (x *ConfirmTelegramEnrollmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmTelegramEnrollmentRequest.ProtoReflect.Descriptor instead. +func (*ConfirmTelegramEnrollmentRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{12} +} + +func (x *ConfirmTelegramEnrollmentRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *ConfirmTelegramEnrollmentRequest) GetEnrollmentToken() string { + if x != nil { + return x.EnrollmentToken + } + return "" +} + +func (x *ConfirmTelegramEnrollmentRequest) GetOtpCode() string { + if x != nil { + return x.OtpCode + } + return "" +} + +type ConfirmTelegramEnrollmentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + ReserveCodes []string `protobuf:"bytes,3,rep,name=reserve_codes,json=reserveCodes,proto3" json:"reserve_codes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConfirmTelegramEnrollmentResponse) Reset() { + *x = ConfirmTelegramEnrollmentResponse{} + mi := &file_sso_twofa_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConfirmTelegramEnrollmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmTelegramEnrollmentResponse) ProtoMessage() {} + +func (x *ConfirmTelegramEnrollmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmTelegramEnrollmentResponse.ProtoReflect.Descriptor instead. +func (*ConfirmTelegramEnrollmentResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{13} +} + +func (x *ConfirmTelegramEnrollmentResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *ConfirmTelegramEnrollmentResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *ConfirmTelegramEnrollmentResponse) GetReserveCodes() []string { + if x != nil { + return x.ReserveCodes + } + return nil +} + +type DisableTelegramRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + TelegramOtpCode *string `protobuf:"bytes,3,opt,name=telegram_otp_code,json=telegramOtpCode,proto3,oneof" json:"telegram_otp_code,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableTelegramRequest) Reset() { + *x = DisableTelegramRequest{} + mi := &file_sso_twofa_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableTelegramRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableTelegramRequest) ProtoMessage() {} + +func (x *DisableTelegramRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableTelegramRequest.ProtoReflect.Descriptor instead. +func (*DisableTelegramRequest) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{14} +} + +func (x *DisableTelegramRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *DisableTelegramRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *DisableTelegramRequest) GetTelegramOtpCode() string { + if x != nil && x.TelegramOtpCode != nil { + return *x.TelegramOtpCode + } + return "" +} + +type DisableTelegramResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DisableTelegramResponse) Reset() { + *x = DisableTelegramResponse{} + mi := &file_sso_twofa_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DisableTelegramResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableTelegramResponse) ProtoMessage() {} + +func (x *DisableTelegramResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_twofa_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DisableTelegramResponse.ProtoReflect.Descriptor instead. +func (*DisableTelegramResponse) Descriptor() ([]byte, []int) { + return file_sso_twofa_proto_rawDescGZIP(), []int{15} +} + +func (x *DisableTelegramResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *DisableTelegramResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_sso_twofa_proto protoreflect.FileDescriptor + +const file_sso_twofa_proto_rawDesc = "" + + "\n" + + "\x0fsso/twofa.proto\x12\btwofa.v1\"\x9d\x01\n" + + "\x10Verify2FaRequest\x12\x1d\n" + + "\n" + + "temp_token\x18\x01 \x01(\tR\ttempToken\x12 \n" + + "\ttotp_code\x18\x02 \x01(\tH\x00R\btotpCode\x88\x01\x01\x12(\n" + + "\rtelegram_code\x18\x03 \x01(\tH\x01R\ftelegramCode\x88\x01\x01B\f\n" + + "\n" + + "_totp_codeB\x10\n" + + "\x0e_telegram_code\"\x8d\x01\n" + + "\x11Verify2FaResponse\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x04 \x01(\tR\amessage\x12#\n" + + "\rreserve_codes\x18\x05 \x03(\tR\freserveCodes\"?\n" + + "\x1aAuthenticatedAccessRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\":\n" + + "\x15GetTwoFaStatusRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\"\xde\x01\n" + + "\x16GetTwoFaStatusResponse\x12!\n" + + "\ftotp_enabled\x18\x01 \x01(\bR\vtotpEnabled\x12)\n" + + "\x10telegram_enabled\x18\x02 \x01(\bR\x0ftelegramEnabled\x126\n" + + "\x17totp_enrollment_pending\x18\x03 \x01(\bR\x15totpEnrollmentPending\x12>\n" + + "\x1btelegram_enrollment_pending\x18\x04 \x01(\bR\x19telegramEnrollmentPending\"\xa0\x01\n" + + "\x1bStartTotpEnrollmentResponse\x12#\n" + + "\rsecret_base32\x18\x01 \x01(\tR\fsecretBase32\x12\x1f\n" + + "\votpauth_uri\x18\x02 \x01(\tR\n" + + "otpauthUri\x12\x16\n" + + "\x06issuer\x18\x03 \x01(\tR\x06issuer\x12#\n" + + "\raccount_label\x18\x04 \x01(\tR\faccountLabel\"^\n" + + "\x1cConfirmTotpEnrollmentRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1b\n" + + "\ttotp_code\x18\x02 \x01(\tR\btotpCode\"v\n" + + "\x1dConfirmTotpEnrollmentResponse\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12#\n" + + "\rreserve_codes\x18\x03 \x03(\tR\freserveCodes\"P\n" + + "\x1cCancelTotpEnrollmentResponse\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\x83\x01\n" + + "\x12DisableTotpRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12 \n" + + "\ttotp_code\x18\x03 \x01(\tH\x00R\btotpCode\x88\x01\x01B\f\n" + + "\n" + + "_totp_code\"G\n" + + "\x13DisableTotpResponse\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\xb2\x01\n" + + "\x1fStartTelegramEnrollmentResponse\x12)\n" + + "\x10enrollment_token\x18\x01 \x01(\tR\x0fenrollmentToken\x12\x1b\n" + + "\tdeep_link\x18\x02 \x01(\tR\bdeepLink\x12!\n" + + "\fbot_username\x18\x03 \x01(\tR\vbotUsername\x12$\n" + + "\x0eexpires_at_iso\x18\x04 \x01(\tR\fexpiresAtIso\"\x8b\x01\n" + + " ConfirmTelegramEnrollmentRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12)\n" + + "\x10enrollment_token\x18\x02 \x01(\tR\x0fenrollmentToken\x12\x19\n" + + "\botp_code\x18\x03 \x01(\tR\aotpCode\"z\n" + + "!ConfirmTelegramEnrollmentResponse\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12#\n" + + "\rreserve_codes\x18\x03 \x03(\tR\freserveCodes\"\x9e\x01\n" + + "\x16DisableTelegramRequest\x12!\n" + + "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12/\n" + + "\x11telegram_otp_code\x18\x03 \x01(\tH\x00R\x0ftelegramOtpCode\x88\x01\x01B\x14\n" + + "\x12_telegram_otp_code\"K\n" + + "\x17DisableTelegramResponse\x12\x16\n" + + "\x06status\x18\x01 \x01(\tR\x06status\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage2\xe2\x06\n" + + "\fTwoFaService\x12D\n" + + "\tVerify2Fa\x12\x1a.twofa.v1.Verify2FaRequest\x1a\x1b.twofa.v1.Verify2FaResponse\x12S\n" + + "\x0eGetTwoFaStatus\x12\x1f.twofa.v1.GetTwoFaStatusRequest\x1a .twofa.v1.GetTwoFaStatusResponse\x12b\n" + + "\x13StartTotpEnrollment\x12$.twofa.v1.AuthenticatedAccessRequest\x1a%.twofa.v1.StartTotpEnrollmentResponse\x12g\n" + + "\x14ConfirmTotpErollment\x12&.twofa.v1.ConfirmTotpEnrollmentRequest\x1a'.twofa.v1.ConfirmTotpEnrollmentResponse\x12d\n" + + "\x14CancelTotpEnrollment\x12$.twofa.v1.AuthenticatedAccessRequest\x1a&.twofa.v1.CancelTotpEnrollmentResponse\x12J\n" + + "\vDisableTotp\x12\x1c.twofa.v1.DisableTotpRequest\x1a\x1d.twofa.v1.DisableTotpResponse\x12j\n" + + "\x17StartTelegramEnrollment\x12$.twofa.v1.AuthenticatedAccessRequest\x1a).twofa.v1.StartTelegramEnrollmentResponse\x12t\n" + + "\x19ConfirmTelegramEnrollment\x12*.twofa.v1.ConfirmTelegramEnrollmentRequest\x1a+.twofa.v1.ConfirmTelegramEnrollmentResponse\x12V\n" + + "\x0fDisableTelegram\x12 .twofa.v1.DisableTelegramRequest\x1a!.twofa.v1.DisableTelegramResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + +var ( + file_sso_twofa_proto_rawDescOnce sync.Once + file_sso_twofa_proto_rawDescData []byte +) + +func file_sso_twofa_proto_rawDescGZIP() []byte { + file_sso_twofa_proto_rawDescOnce.Do(func() { + file_sso_twofa_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sso_twofa_proto_rawDesc), len(file_sso_twofa_proto_rawDesc))) + }) + return file_sso_twofa_proto_rawDescData +} + +var file_sso_twofa_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_sso_twofa_proto_goTypes = []any{ + (*Verify2FaRequest)(nil), // 0: twofa.v1.Verify2FaRequest + (*Verify2FaResponse)(nil), // 1: twofa.v1.Verify2FaResponse + (*AuthenticatedAccessRequest)(nil), // 2: twofa.v1.AuthenticatedAccessRequest + (*GetTwoFaStatusRequest)(nil), // 3: twofa.v1.GetTwoFaStatusRequest + (*GetTwoFaStatusResponse)(nil), // 4: twofa.v1.GetTwoFaStatusResponse + (*StartTotpEnrollmentResponse)(nil), // 5: twofa.v1.StartTotpEnrollmentResponse + (*ConfirmTotpEnrollmentRequest)(nil), // 6: twofa.v1.ConfirmTotpEnrollmentRequest + (*ConfirmTotpEnrollmentResponse)(nil), // 7: twofa.v1.ConfirmTotpEnrollmentResponse + (*CancelTotpEnrollmentResponse)(nil), // 8: twofa.v1.CancelTotpEnrollmentResponse + (*DisableTotpRequest)(nil), // 9: twofa.v1.DisableTotpRequest + (*DisableTotpResponse)(nil), // 10: twofa.v1.DisableTotpResponse + (*StartTelegramEnrollmentResponse)(nil), // 11: twofa.v1.StartTelegramEnrollmentResponse + (*ConfirmTelegramEnrollmentRequest)(nil), // 12: twofa.v1.ConfirmTelegramEnrollmentRequest + (*ConfirmTelegramEnrollmentResponse)(nil), // 13: twofa.v1.ConfirmTelegramEnrollmentResponse + (*DisableTelegramRequest)(nil), // 14: twofa.v1.DisableTelegramRequest + (*DisableTelegramResponse)(nil), // 15: twofa.v1.DisableTelegramResponse +} +var file_sso_twofa_proto_depIdxs = []int32{ + 0, // 0: twofa.v1.TwoFaService.Verify2Fa:input_type -> twofa.v1.Verify2FaRequest + 3, // 1: twofa.v1.TwoFaService.GetTwoFaStatus:input_type -> twofa.v1.GetTwoFaStatusRequest + 2, // 2: twofa.v1.TwoFaService.StartTotpEnrollment:input_type -> twofa.v1.AuthenticatedAccessRequest + 6, // 3: twofa.v1.TwoFaService.ConfirmTotpErollment:input_type -> twofa.v1.ConfirmTotpEnrollmentRequest + 2, // 4: twofa.v1.TwoFaService.CancelTotpEnrollment:input_type -> twofa.v1.AuthenticatedAccessRequest + 9, // 5: twofa.v1.TwoFaService.DisableTotp:input_type -> twofa.v1.DisableTotpRequest + 2, // 6: twofa.v1.TwoFaService.StartTelegramEnrollment:input_type -> twofa.v1.AuthenticatedAccessRequest + 12, // 7: twofa.v1.TwoFaService.ConfirmTelegramEnrollment:input_type -> twofa.v1.ConfirmTelegramEnrollmentRequest + 14, // 8: twofa.v1.TwoFaService.DisableTelegram:input_type -> twofa.v1.DisableTelegramRequest + 1, // 9: twofa.v1.TwoFaService.Verify2Fa:output_type -> twofa.v1.Verify2FaResponse + 4, // 10: twofa.v1.TwoFaService.GetTwoFaStatus:output_type -> twofa.v1.GetTwoFaStatusResponse + 5, // 11: twofa.v1.TwoFaService.StartTotpEnrollment:output_type -> twofa.v1.StartTotpEnrollmentResponse + 7, // 12: twofa.v1.TwoFaService.ConfirmTotpErollment:output_type -> twofa.v1.ConfirmTotpEnrollmentResponse + 8, // 13: twofa.v1.TwoFaService.CancelTotpEnrollment:output_type -> twofa.v1.CancelTotpEnrollmentResponse + 10, // 14: twofa.v1.TwoFaService.DisableTotp:output_type -> twofa.v1.DisableTotpResponse + 11, // 15: twofa.v1.TwoFaService.StartTelegramEnrollment:output_type -> twofa.v1.StartTelegramEnrollmentResponse + 13, // 16: twofa.v1.TwoFaService.ConfirmTelegramEnrollment:output_type -> twofa.v1.ConfirmTelegramEnrollmentResponse + 15, // 17: twofa.v1.TwoFaService.DisableTelegram:output_type -> twofa.v1.DisableTelegramResponse + 9, // [9:18] is the sub-list for method output_type + 0, // [0:9] 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_sso_twofa_proto_init() } +func file_sso_twofa_proto_init() { + if File_sso_twofa_proto != nil { + return + } + file_sso_twofa_proto_msgTypes[0].OneofWrappers = []any{} + file_sso_twofa_proto_msgTypes[9].OneofWrappers = []any{} + file_sso_twofa_proto_msgTypes[14].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_twofa_proto_rawDesc), len(file_sso_twofa_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sso_twofa_proto_goTypes, + DependencyIndexes: file_sso_twofa_proto_depIdxs, + MessageInfos: file_sso_twofa_proto_msgTypes, + }.Build() + File_sso_twofa_proto = out.File + file_sso_twofa_proto_goTypes = nil + file_sso_twofa_proto_depIdxs = nil +} diff --git a/gen/go/sso/twofa_grpc.pb.go b/gen/go/sso/twofa_grpc.pb.go new file mode 100644 index 0000000..bd5da39 --- /dev/null +++ b/gen/go/sso/twofa_grpc.pb.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 +// source: sso/twofa.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + TwoFaService_Verify2Fa_FullMethodName = "/twofa.v1.TwoFaService/Verify2Fa" + TwoFaService_GetTwoFaStatus_FullMethodName = "/twofa.v1.TwoFaService/GetTwoFaStatus" + TwoFaService_StartTotpEnrollment_FullMethodName = "/twofa.v1.TwoFaService/StartTotpEnrollment" + TwoFaService_ConfirmTotpErollment_FullMethodName = "/twofa.v1.TwoFaService/ConfirmTotpErollment" + TwoFaService_CancelTotpEnrollment_FullMethodName = "/twofa.v1.TwoFaService/CancelTotpEnrollment" + TwoFaService_DisableTotp_FullMethodName = "/twofa.v1.TwoFaService/DisableTotp" + TwoFaService_StartTelegramEnrollment_FullMethodName = "/twofa.v1.TwoFaService/StartTelegramEnrollment" + TwoFaService_ConfirmTelegramEnrollment_FullMethodName = "/twofa.v1.TwoFaService/ConfirmTelegramEnrollment" + TwoFaService_DisableTelegram_FullMethodName = "/twofa.v1.TwoFaService/DisableTelegram" +) + +// TwoFaServiceClient is the client API for TwoFaService 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 TwoFaServiceClient interface { + Verify2Fa(ctx context.Context, in *Verify2FaRequest, opts ...grpc.CallOption) (*Verify2FaResponse, error) + GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error) + StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error) + ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error) + CancelTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*CancelTotpEnrollmentResponse, error) + DisableTotp(ctx context.Context, in *DisableTotpRequest, opts ...grpc.CallOption) (*DisableTotpResponse, error) + StartTelegramEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTelegramEnrollmentResponse, error) + ConfirmTelegramEnrollment(ctx context.Context, in *ConfirmTelegramEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTelegramEnrollmentResponse, error) + DisableTelegram(ctx context.Context, in *DisableTelegramRequest, opts ...grpc.CallOption) (*DisableTelegramResponse, error) +} + +type twoFaServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTwoFaServiceClient(cc grpc.ClientConnInterface) TwoFaServiceClient { + return &twoFaServiceClient{cc} +} + +func (c *twoFaServiceClient) Verify2Fa(ctx context.Context, in *Verify2FaRequest, opts ...grpc.CallOption) (*Verify2FaResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Verify2FaResponse) + err := c.cc.Invoke(ctx, TwoFaService_Verify2Fa_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetTwoFaStatusResponse) + err := c.cc.Invoke(ctx, TwoFaService_GetTwoFaStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StartTotpEnrollmentResponse) + err := c.cc.Invoke(ctx, TwoFaService_StartTotpEnrollment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ConfirmTotpEnrollmentResponse) + err := c.cc.Invoke(ctx, TwoFaService_ConfirmTotpErollment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) CancelTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*CancelTotpEnrollmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CancelTotpEnrollmentResponse) + err := c.cc.Invoke(ctx, TwoFaService_CancelTotpEnrollment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) DisableTotp(ctx context.Context, in *DisableTotpRequest, opts ...grpc.CallOption) (*DisableTotpResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DisableTotpResponse) + err := c.cc.Invoke(ctx, TwoFaService_DisableTotp_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) StartTelegramEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTelegramEnrollmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StartTelegramEnrollmentResponse) + err := c.cc.Invoke(ctx, TwoFaService_StartTelegramEnrollment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) ConfirmTelegramEnrollment(ctx context.Context, in *ConfirmTelegramEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTelegramEnrollmentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ConfirmTelegramEnrollmentResponse) + err := c.cc.Invoke(ctx, TwoFaService_ConfirmTelegramEnrollment_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *twoFaServiceClient) DisableTelegram(ctx context.Context, in *DisableTelegramRequest, opts ...grpc.CallOption) (*DisableTelegramResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DisableTelegramResponse) + err := c.cc.Invoke(ctx, TwoFaService_DisableTelegram_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TwoFaServiceServer is the server API for TwoFaService service. +// All implementations must embed UnimplementedTwoFaServiceServer +// for forward compatibility. +type TwoFaServiceServer interface { + Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error) + GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) + StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error) + ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error) + CancelTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*CancelTotpEnrollmentResponse, error) + DisableTotp(context.Context, *DisableTotpRequest) (*DisableTotpResponse, error) + StartTelegramEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTelegramEnrollmentResponse, error) + ConfirmTelegramEnrollment(context.Context, *ConfirmTelegramEnrollmentRequest) (*ConfirmTelegramEnrollmentResponse, error) + DisableTelegram(context.Context, *DisableTelegramRequest) (*DisableTelegramResponse, error) + mustEmbedUnimplementedTwoFaServiceServer() +} + +// UnimplementedTwoFaServiceServer must 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 UnimplementedTwoFaServiceServer struct{} + +func (UnimplementedTwoFaServiceServer) Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Verify2Fa not implemented") +} +func (UnimplementedTwoFaServiceServer) GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetTwoFaStatus not implemented") +} +func (UnimplementedTwoFaServiceServer) StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method StartTotpEnrollment not implemented") +} +func (UnimplementedTwoFaServiceServer) ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ConfirmTotpErollment not implemented") +} +func (UnimplementedTwoFaServiceServer) CancelTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*CancelTotpEnrollmentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CancelTotpEnrollment not implemented") +} +func (UnimplementedTwoFaServiceServer) DisableTotp(context.Context, *DisableTotpRequest) (*DisableTotpResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DisableTotp not implemented") +} +func (UnimplementedTwoFaServiceServer) StartTelegramEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTelegramEnrollmentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method StartTelegramEnrollment not implemented") +} +func (UnimplementedTwoFaServiceServer) ConfirmTelegramEnrollment(context.Context, *ConfirmTelegramEnrollmentRequest) (*ConfirmTelegramEnrollmentResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ConfirmTelegramEnrollment not implemented") +} +func (UnimplementedTwoFaServiceServer) DisableTelegram(context.Context, *DisableTelegramRequest) (*DisableTelegramResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DisableTelegram not implemented") +} +func (UnimplementedTwoFaServiceServer) mustEmbedUnimplementedTwoFaServiceServer() {} +func (UnimplementedTwoFaServiceServer) testEmbeddedByValue() {} + +// UnsafeTwoFaServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TwoFaServiceServer will +// result in compilation errors. +type UnsafeTwoFaServiceServer interface { + mustEmbedUnimplementedTwoFaServiceServer() +} + +func RegisterTwoFaServiceServer(s grpc.ServiceRegistrar, srv TwoFaServiceServer) { + // If the following call panics, it indicates UnimplementedTwoFaServiceServer 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(&TwoFaService_ServiceDesc, srv) +} + +func _TwoFaService_Verify2Fa_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Verify2FaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).Verify2Fa(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_Verify2Fa_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).Verify2Fa(ctx, req.(*Verify2FaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_GetTwoFaStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTwoFaStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).GetTwoFaStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_GetTwoFaStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).GetTwoFaStatus(ctx, req.(*GetTwoFaStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_StartTotpEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthenticatedAccessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).StartTotpEnrollment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_StartTotpEnrollment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).StartTotpEnrollment(ctx, req.(*AuthenticatedAccessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_ConfirmTotpErollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfirmTotpEnrollmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).ConfirmTotpErollment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_ConfirmTotpErollment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).ConfirmTotpErollment(ctx, req.(*ConfirmTotpEnrollmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_CancelTotpEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthenticatedAccessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).CancelTotpEnrollment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_CancelTotpEnrollment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).CancelTotpEnrollment(ctx, req.(*AuthenticatedAccessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_DisableTotp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisableTotpRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).DisableTotp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_DisableTotp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).DisableTotp(ctx, req.(*DisableTotpRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_StartTelegramEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AuthenticatedAccessRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).StartTelegramEnrollment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_StartTelegramEnrollment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).StartTelegramEnrollment(ctx, req.(*AuthenticatedAccessRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_ConfirmTelegramEnrollment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfirmTelegramEnrollmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).ConfirmTelegramEnrollment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_ConfirmTelegramEnrollment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).ConfirmTelegramEnrollment(ctx, req.(*ConfirmTelegramEnrollmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TwoFaService_DisableTelegram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisableTelegramRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TwoFaServiceServer).DisableTelegram(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TwoFaService_DisableTelegram_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TwoFaServiceServer).DisableTelegram(ctx, req.(*DisableTelegramRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// TwoFaService_ServiceDesc is the grpc.ServiceDesc for TwoFaService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TwoFaService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "twofa.v1.TwoFaService", + HandlerType: (*TwoFaServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Verify2Fa", + Handler: _TwoFaService_Verify2Fa_Handler, + }, + { + MethodName: "GetTwoFaStatus", + Handler: _TwoFaService_GetTwoFaStatus_Handler, + }, + { + MethodName: "StartTotpEnrollment", + Handler: _TwoFaService_StartTotpEnrollment_Handler, + }, + { + MethodName: "ConfirmTotpErollment", + Handler: _TwoFaService_ConfirmTotpErollment_Handler, + }, + { + MethodName: "CancelTotpEnrollment", + Handler: _TwoFaService_CancelTotpEnrollment_Handler, + }, + { + MethodName: "DisableTotp", + Handler: _TwoFaService_DisableTotp_Handler, + }, + { + MethodName: "StartTelegramEnrollment", + Handler: _TwoFaService_StartTelegramEnrollment_Handler, + }, + { + MethodName: "ConfirmTelegramEnrollment", + Handler: _TwoFaService_ConfirmTelegramEnrollment_Handler, + }, + { + MethodName: "DisableTelegram", + Handler: _TwoFaService_DisableTelegram_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sso/twofa.proto", +} diff --git a/gen/search/search.ts b/gen/search/search.ts new file mode 100644 index 0000000..c0fc1b0 --- /dev/null +++ b/gen/search/search.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: search/search.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "search.v1"; + +export interface SearchUsersRequest { + query: string; + userId: string; + sessionId: string; + status?: string | undefined; +} + +export interface SearchUserItem { + id: string; + username: string; + fullName: string; + avatarUrl: string; + status: string; + isPublic: boolean; +} + +export interface SearchUsersResponse { + users: SearchUserItem[]; +} + +export const SEARCH_V1_PACKAGE_NAME = "search.v1"; + +export interface SearchServiceClient { + /** + * В будущем сюда добавятся: + * rpc SearchMessages (SearchMessagesRequest) returns (SearchMessagesResponse); + * rpc SearchTickets (SearchTicketsRequest) returns (SearchTicketsResponse); + */ + + searchUsers(request: SearchUsersRequest, metadata?: Metadata): Observable; +} + +export interface SearchServiceController { + /** + * В будущем сюда добавятся: + * rpc SearchMessages (SearchMessagesRequest) returns (SearchMessagesResponse); + * rpc SearchTickets (SearchTicketsRequest) returns (SearchTicketsResponse); + */ + + searchUsers( + request: SearchUsersRequest, + metadata?: Metadata, + ): Promise | Observable | SearchUsersResponse; +} + +export function SearchServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = ["searchUsers"]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("SearchService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("SearchService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const SEARCH_SERVICE_NAME = "SearchService"; diff --git a/gen/sso/account.ts b/gen/sso/account.ts new file mode 100644 index 0000000..829a801 --- /dev/null +++ b/gen/sso/account.ts @@ -0,0 +1,360 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/account.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "account.v1"; + +export interface GetAccountRequest { + id: string; +} + +export interface GetAccountResponse { + id: string; + username: string; + email: string; + phone: string; + fullName: string; + isLdap: boolean; + status: string; + roles: string[]; + avatarUrl: string; + employeeId?: string | undefined; + presence: string; + lastActive: string; + customStatusText: string; + customStatusEmoji: string; + timezone: string; + language: string; + twoFaEnabled: boolean; + hasPin: boolean; +} + +export interface ChangePasswordRequest { + userId: string; + oldPassword: string; + newPassword: string; + code?: string | undefined; + sessionId: string; +} + +export interface ChangePasswordResponse { + success: boolean; + message: string; +} + +export interface CreateUserRequest { + username: string; + password: string; + roles: string[]; +} + +export interface CreateUserResponse { + success: boolean; + message: string; +} + +export interface DeleteUserRequest { + userId: string; +} + +export interface DeleteUserResponse { + success: boolean; + message: string; +} + +export interface ChangeDataRequest { + userId: string; + sessionId: string; + email?: string | undefined; + phone?: string | undefined; + fullName?: string | undefined; + avatarUrl?: string | undefined; + customStatusText?: string | undefined; + customStatusEmoji?: string | undefined; + timezone?: string | undefined; + language?: string | undefined; + isPublic?: boolean | undefined; +} + +export interface ChangeDataResponse { + success: boolean; + message: string; +} + +export interface AssignRoleRequest { + userId: string; + /** В gRPC передаем как string, внутри преобразуем в Int */ + roleId: string; +} + +export interface AssignRoleResponse { + success: boolean; + message: string; +} + +export interface RevokeRoleRequest { + userId: string; + roleId: string; +} + +export interface RevokeRoleResponse { + success: boolean; + message: string; +} + +export interface AdminResetPasswordRequest { + userId: string; + newPassword: string; +} + +export interface AdminResetPasswordResponse { + success: boolean; + message: string; +} + +export interface SetPinRequest { + userId: string; + sessionId: string; + pin: string; +} + +export interface SetPinResponse { + success: boolean; + message: string; +} + +export interface UnlockPinRequest { + userId: string; + sessionId: string; + pin: string; +} + +export interface UnlockPinResponse { + success: boolean; + message: string; +} + +export interface GetPinStatusRequest { + userId: string; + sessionId: string; +} + +export interface GetPinStatusResponse { + hasPin: boolean; + isLocked: boolean; + lockUntil: string; +} + +export interface RemovePinRequest { + pin: string; + userId: string; + sessionId: string; +} + +export interface RemovePinResponse { + success: boolean; + message: string; +} + +export interface BlockUserRequest { + /** Кого блокируем */ + userId: string; + /** Кто блокирует */ + adminId: string; + reason?: string | undefined; +} + +export interface BlockUserResponse { + success: boolean; + message: string; +} + +export interface UnblockUserRequest { + userId: string; + adminId: string; +} + +export interface UnblockUserResponse { + success: boolean; + message: string; +} + +export interface BlockIpRequest { + ipAddress: string; + adminId: string; + reason?: string | undefined; +} + +export interface BlockIpResponse { + success: boolean; + message: string; +} + +export interface UnblockIpRequest { + ipAddress: string; + adminId: string; +} + +export interface UnblockIpResponse { + success: boolean; + message: string; +} + +export const ACCOUNT_V1_PACKAGE_NAME = "account.v1"; + +export interface AccountServiceClient { + getAccount(request: GetAccountRequest, metadata?: Metadata): Observable; + + changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable; + + adminResetPassword(request: AdminResetPasswordRequest, metadata?: Metadata): Observable; + + createUser(request: CreateUserRequest, metadata?: Metadata): Observable; + + deleteUser(request: DeleteUserRequest, metadata?: Metadata): Observable; + + changeData(request: ChangeDataRequest, metadata?: Metadata): Observable; + + assignRole(request: AssignRoleRequest, metadata?: Metadata): Observable; + + revokeRole(request: RevokeRoleRequest, metadata?: Metadata): Observable; + + setPin(request: SetPinRequest, metadata?: Metadata): Observable; + + unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable; + + getPinStatus(request: GetPinStatusRequest, metadata?: Metadata): Observable; + + removePin(request: RemovePinRequest, metadata?: Metadata): Observable; + + blockUser(request: BlockUserRequest, metadata?: Metadata): Observable; + + unblockUser(request: UnblockUserRequest, metadata?: Metadata): Observable; + + blockIp(request: BlockIpRequest, metadata?: Metadata): Observable; + + unblockIp(request: UnblockIpRequest, metadata?: Metadata): Observable; +} + +export interface AccountServiceController { + getAccount( + request: GetAccountRequest, + metadata?: Metadata, + ): Promise | Observable | GetAccountResponse; + + changePassword( + request: ChangePasswordRequest, + metadata?: Metadata, + ): Promise | Observable | ChangePasswordResponse; + + adminResetPassword( + request: AdminResetPasswordRequest, + metadata?: Metadata, + ): Promise | Observable | AdminResetPasswordResponse; + + createUser( + request: CreateUserRequest, + metadata?: Metadata, + ): Promise | Observable | CreateUserResponse; + + deleteUser( + request: DeleteUserRequest, + metadata?: Metadata, + ): Promise | Observable | DeleteUserResponse; + + changeData( + request: ChangeDataRequest, + metadata?: Metadata, + ): Promise | Observable | ChangeDataResponse; + + assignRole( + request: AssignRoleRequest, + metadata?: Metadata, + ): Promise | Observable | AssignRoleResponse; + + revokeRole( + request: RevokeRoleRequest, + metadata?: Metadata, + ): Promise | Observable | RevokeRoleResponse; + + setPin( + request: SetPinRequest, + metadata?: Metadata, + ): Promise | Observable | SetPinResponse; + + unlockPin( + request: UnlockPinRequest, + metadata?: Metadata, + ): Promise | Observable | UnlockPinResponse; + + getPinStatus( + request: GetPinStatusRequest, + metadata?: Metadata, + ): Promise | Observable | GetPinStatusResponse; + + removePin( + request: RemovePinRequest, + metadata?: Metadata, + ): Promise | Observable | RemovePinResponse; + + blockUser( + request: BlockUserRequest, + metadata?: Metadata, + ): Promise | Observable | BlockUserResponse; + + unblockUser( + request: UnblockUserRequest, + metadata?: Metadata, + ): Promise | Observable | UnblockUserResponse; + + blockIp( + request: BlockIpRequest, + metadata?: Metadata, + ): Promise | Observable | BlockIpResponse; + + unblockIp( + request: UnblockIpRequest, + metadata?: Metadata, + ): Promise | Observable | UnblockIpResponse; +} + +export function AccountServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = [ + "getAccount", + "changePassword", + "adminResetPassword", + "createUser", + "deleteUser", + "changeData", + "assignRole", + "revokeRole", + "setPin", + "unlockPin", + "getPinStatus", + "removePin", + "blockUser", + "unblockUser", + "blockIp", + "unblockIp", + ]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const ACCOUNT_SERVICE_NAME = "AccountService"; diff --git a/gen/sso/auth.ts b/gen/sso/auth.ts new file mode 100644 index 0000000..081cdcd --- /dev/null +++ b/gen/sso/auth.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/auth.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "auth.v1"; + +export interface LoginRequest { + username: string; + password: string; +} + +export interface LoginResponse { + accessToken: string; + refreshToken: string; + status: string; + need2fa: boolean; + tempToken?: string | undefined; + message?: string | undefined; + errorCode?: string | undefined; +} + +export interface RefreshRequest { + refreshToken: string; +} + +export interface RefreshResponse { + accessToken: string; + refreshToken: string; +} + +export interface LogoutRequest { + userId: string; + sessionId: string; +} + +export interface LogoutResponse { + success: boolean; + message: string; +} + +export interface VerifyTokenRequest { + token: string; +} + +export interface VerifyTokenResponse { + isValid: boolean; + errorMessage?: string | undefined; + id?: string | undefined; + username?: string | undefined; + roleLevel?: number | undefined; + permissions: string[]; + sessionId?: string | undefined; + requiresPin?: boolean | undefined; +} + +export interface GetAccountRoleLevelRequest { + accountId: string; +} + +export interface GetAccountRoleLevelResponse { + found: boolean; + roleLevel: number; +} + +export interface GetSessionRequest { + userId: string; + currentSessionId: string; +} + +export interface SessionItem { + /** Здесь будет лежать захэшированный ID */ + id: string; + ipAddress: string; + userAgent: string; + /** Unix timestamp в миллисекундах */ + lastActivity: number; + /** Флаг текущей сессии */ + isCurrent: boolean; +} + +export interface GetSessionsResponse { + sessions: SessionItem[]; +} + +export interface TerminateSessionRequest { + userId: string; + /** Хэш сессии, которую нужно убить */ + targetHash: string; +} + +export interface TerminateSessionResponse { + success: boolean; + message: string; +} + +export const AUTH_V1_PACKAGE_NAME = "auth.v1"; + +export interface AuthServiceClient { + login(request: LoginRequest, metadata?: Metadata): Observable; + + refresh(request: RefreshRequest, metadata?: Metadata): Observable; + + verifyToken(request: VerifyTokenRequest, metadata?: Metadata): Observable; + + getAccountRoleLevel( + request: GetAccountRoleLevelRequest, + metadata?: Metadata, + ): Observable; + + logout(request: LogoutRequest, metadata?: Metadata): Observable; + + logoutOther(request: LogoutRequest, metadata?: Metadata): Observable; + + getSessions(request: GetSessionRequest, metadata?: Metadata): Observable; + + terminateSession(request: TerminateSessionRequest, metadata?: Metadata): Observable; +} + +export interface AuthServiceController { + login(request: LoginRequest, metadata?: Metadata): Promise | Observable | LoginResponse; + + refresh( + request: RefreshRequest, + metadata?: Metadata, + ): Promise | Observable | RefreshResponse; + + verifyToken( + request: VerifyTokenRequest, + metadata?: Metadata, + ): Promise | Observable | VerifyTokenResponse; + + getAccountRoleLevel( + request: GetAccountRoleLevelRequest, + metadata?: Metadata, + ): Promise | Observable | GetAccountRoleLevelResponse; + + logout( + request: LogoutRequest, + metadata?: Metadata, + ): Promise | Observable | LogoutResponse; + + logoutOther( + request: LogoutRequest, + metadata?: Metadata, + ): Promise | Observable | LogoutResponse; + + getSessions( + request: GetSessionRequest, + metadata?: Metadata, + ): Promise | Observable | GetSessionsResponse; + + terminateSession( + request: TerminateSessionRequest, + metadata?: Metadata, + ): Promise | Observable | TerminateSessionResponse; +} + +export function AuthServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = [ + "login", + "refresh", + "verifyToken", + "getAccountRoleLevel", + "logout", + "logoutOther", + "getSessions", + "terminateSession", + ]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const AUTH_SERVICE_NAME = "AuthService"; diff --git a/gen/sso/ldap-auth.ts b/gen/sso/ldap-auth.ts new file mode 100644 index 0000000..c8e5a52 --- /dev/null +++ b/gen/sso/ldap-auth.ts @@ -0,0 +1,56 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/ldap-auth.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; +import { UserData } from "./ldap"; + +export const protobufPackage = "ldap_auth.v1"; + +/** --- Авторизация --- */ +export interface VerifyRequest { + username: string; + password: string; +} + +export interface VerifyResponse { + success: boolean; + errorMessage: string; + /** Отдаем полные данные при успешном входе */ + user: UserData | undefined; +} + +export const LDAP_AUTH_V1_PACKAGE_NAME = "ldap_auth.v1"; + +export interface LdapAuthServiceClient { + verifyUser(request: VerifyRequest, metadata?: Metadata): Observable; +} + +export interface LdapAuthServiceController { + verifyUser( + request: VerifyRequest, + metadata?: Metadata, + ): Promise | Observable | VerifyResponse; +} + +export function LdapAuthServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = ["verifyUser"]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("LdapAuthService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("LdapAuthService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const LDAP_AUTH_SERVICE_NAME = "LdapAuthService"; diff --git a/gen/sso/ldap.ts b/gen/sso/ldap.ts new file mode 100644 index 0000000..187d5b4 --- /dev/null +++ b/gen/sso/ldap.ts @@ -0,0 +1,211 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/ldap.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "ldap.v1"; + +/** + * ========================================== + * БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ + * ========================================== + */ +export interface EmptyRequest { +} + +/** Стандартный ответ для мутаций (создание, обновление, удаление) */ +export interface StatusResponse { + success: boolean; + errorMessage: string; +} + +/** Полная модель пользователя */ +export interface UserData { + /** Полный путь в AD (Distinguished Name) */ + dn: string; + /** Логин (sAMAccountName) */ + username: string; + /** ФИО (displayName) */ + displayName: string; + /** Почта (mail) */ + email: string; + /** Описание/Должность (description) */ + description: string; + /** Аватарка в байтах (thumbnailPhoto) */ + avatar: Uint8Array; + /** Список групп */ + groups: string[]; + /** Статус аккаунта */ + isActive: boolean; + phone: string; +} + +/** Модель группы */ +export interface GroupData { + dn: string; + /** Короткое имя группы (cn) */ + name: string; +} + +/** --- Списки --- */ +export interface UserListResponse { + success: boolean; + errorMessage: string; + users: UserData[]; +} + +export interface GroupListResponse { + success: boolean; + errorMessage: string; + groups: GroupData[]; +} + +/** --- Управление профилем --- */ +export interface CreateUserRequest { + username: string; + fullName: string; + password: string; + /** Сразу при создании можно задать почту */ + email?: string | undefined; +} + +/** Запрос на обновление. Используем optional для частичного обновления. */ +export interface UpdateUserRequest { + /** Обязательное поле: кого обновляем */ + username: string; + /** Новое ФИО (повлечет Rename CN) */ + displayName?: + | string + | undefined; + /** Новая почта */ + email?: + | string + | undefined; + /** Новое описание */ + description?: + | string + | undefined; + /** Новая аватарка (бинарник картинки) */ + avatar?: Uint8Array | undefined; +} + +export interface ChangePasswordRequest { + username: string; + newPassword: string; +} + +export interface ToggleStatusRequest { + username: string; + /** true - включить (512), false - отключить (514) */ + setActive: boolean; +} + +/** --- Управление членством в группах --- */ +export interface GroupMemberRequest { + /** Логин пользователя */ + username: string; + /** Полный путь группы (в которую добавляем / из которой удаляем) */ + groupDn: string; +} + +export const LDAP_V1_PACKAGE_NAME = "ldap.v1"; + +export interface LdapServiceClient { + /** Управление Пользователями (Bind системного аккаунта) --- */ + + getUsers(request: EmptyRequest, metadata?: Metadata): Observable; + + createUser(request: CreateUserRequest, metadata?: Metadata): Observable; + + updateUser(request: UpdateUserRequest, metadata?: Metadata): Observable; + + changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable; + + toggleUserStatus(request: ToggleStatusRequest, metadata?: Metadata): Observable; + + /** Управление Группами --- */ + + getGroups(request: EmptyRequest, metadata?: Metadata): Observable; + + addUserToGroup(request: GroupMemberRequest, metadata?: Metadata): Observable; + + removeUserFromGroup(request: GroupMemberRequest, metadata?: Metadata): Observable; +} + +export interface LdapServiceController { + /** Управление Пользователями (Bind системного аккаунта) --- */ + + getUsers( + request: EmptyRequest, + metadata?: Metadata, + ): Promise | Observable | UserListResponse; + + createUser( + request: CreateUserRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; + + updateUser( + request: UpdateUserRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; + + changePassword( + request: ChangePasswordRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; + + toggleUserStatus( + request: ToggleStatusRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; + + /** Управление Группами --- */ + + getGroups( + request: EmptyRequest, + metadata?: Metadata, + ): Promise | Observable | GroupListResponse; + + addUserToGroup( + request: GroupMemberRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; + + removeUserFromGroup( + request: GroupMemberRequest, + metadata?: Metadata, + ): Promise | Observable | StatusResponse; +} + +export function LdapServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = [ + "getUsers", + "createUser", + "updateUser", + "changePassword", + "toggleUserStatus", + "getGroups", + "addUserToGroup", + "removeUserFromGroup", + ]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("LdapService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("LdapService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const LDAP_SERVICE_NAME = "LdapService"; diff --git a/gen/sso/rbac.ts b/gen/sso/rbac.ts new file mode 100644 index 0000000..f64d24a --- /dev/null +++ b/gen/sso/rbac.ts @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/rbac.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "rbac.v1"; + +export interface GetAllPermissionsRequest { + userId: string; + sessionId: string; +} + +export interface GetAllPermissionsResponse { + permissions: Permission[]; +} + +export interface Permission { + id: string; + code: string; + description: string; + module: string; + roles: string[]; +} + +export interface GetAllRolesRequest { + userId: string; + sessionId: string; +} + +export interface GetAllRolesResponse { + roles: Roles[]; +} + +export interface CreateRoleRequest { + name: string; + level: number; + permissionCodes: string[]; +} + +export interface UpdateRoleRequest { + id: string; + name?: string | undefined; + level?: number | undefined; + permissionCodes: string[]; +} + +export interface ModifyRoleResponse { + success: boolean; + message: string; +} + +export interface DeleteRoleRequest { + id: string; +} + +export interface DeleteRoleResponse { + success: boolean; + message: string; + fallbackRoleName?: string | undefined; +} + +export interface CreatePermissionRequest { + code: string; + description: string; + module: string; +} + +export interface UpdatePermissionRequest { + id: string; + /** Привязка к конкретным ролям */ + roleIds: string[]; +} + +export interface ModifyPermissionResponse { + success: boolean; + message: string; +} + +export interface Roles { + id: string; + name: string; + level: number; + permissions: string[]; + ldapMapping: string[]; + accounts: string[]; +} + +export const RBAC_V1_PACKAGE_NAME = "rbac.v1"; + +export interface RbacServiceClient { + createRole(request: CreateRoleRequest, metadata?: Metadata): Observable; + + updateRole(request: UpdateRoleRequest, metadata?: Metadata): Observable; + + deleteRole(request: DeleteRoleRequest, metadata?: Metadata): Observable; + + createPermission(request: CreatePermissionRequest, metadata?: Metadata): Observable; + + updatePermission(request: UpdatePermissionRequest, metadata?: Metadata): Observable; + + getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable; + + getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable; +} + +export interface RbacServiceController { + createRole( + request: CreateRoleRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyRoleResponse; + + updateRole( + request: UpdateRoleRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyRoleResponse; + + deleteRole( + request: DeleteRoleRequest, + metadata?: Metadata, + ): Promise | Observable | DeleteRoleResponse; + + createPermission( + request: CreatePermissionRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyPermissionResponse; + + updatePermission( + request: UpdatePermissionRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyPermissionResponse; + + getAllPermissions( + request: GetAllPermissionsRequest, + metadata?: Metadata, + ): Promise | Observable | GetAllPermissionsResponse; + + getAllRoles( + request: GetAllRolesRequest, + metadata?: Metadata, + ): Promise | Observable | GetAllRolesResponse; +} + +export function RbacServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = [ + "createRole", + "updateRole", + "deleteRole", + "createPermission", + "updatePermission", + "getAllPermissions", + "getAllRoles", + ]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("RbacService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const RBAC_SERVICE_NAME = "RbacService"; diff --git a/gen/sso/twofa.ts b/gen/sso/twofa.ts new file mode 100644 index 0000000..574c724 --- /dev/null +++ b/gen/sso/twofa.ts @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.6 +// protoc v3.21.12 +// source: sso/twofa.proto + +/* eslint-disable */ +import type { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; +import { Observable } from "rxjs"; + +export const protobufPackage = "twofa.v1"; + +export interface Verify2FaRequest { + tempToken: string; + totpCode?: string | undefined; + telegramCode?: string | undefined; +} + +export interface Verify2FaResponse { + accessToken: string; + status: string; + message: string; + reserveCodes: string[]; +} + +export interface AuthenticatedAccessRequest { + accessToken: string; +} + +export interface GetTwoFaStatusRequest { + accessToken: string; +} + +export interface GetTwoFaStatusResponse { + totpEnabled: boolean; + telegramEnabled: boolean; + totpEnrollmentPending: boolean; + telegramEnrollmentPending: boolean; +} + +export interface StartTotpEnrollmentResponse { + secretBase32: string; + otpauthUri: string; + issuer: string; + accountLabel: string; +} + +export interface ConfirmTotpEnrollmentRequest { + accessToken: string; + totpCode: string; +} + +export interface ConfirmTotpEnrollmentResponse { + status: string; + message: string; + reserveCodes: string[]; +} + +export interface CancelTotpEnrollmentResponse { + status: string; + message: string; +} + +export interface DisableTotpRequest { + accessToken: string; + password: string; + totpCode?: string | undefined; +} + +export interface DisableTotpResponse { + status: string; + message: string; +} + +export interface StartTelegramEnrollmentResponse { + enrollmentToken: string; + deepLink: string; + botUsername: string; + expiresAtIso: string; +} + +export interface ConfirmTelegramEnrollmentRequest { + accessToken: string; + enrollmentToken: string; + otpCode: string; +} + +export interface ConfirmTelegramEnrollmentResponse { + status: string; + message: string; + reserveCodes: string[]; +} + +export interface DisableTelegramRequest { + accessToken: string; + password: string; + telegramOtpCode?: string | undefined; +} + +export interface DisableTelegramResponse { + status: string; + message: string; +} + +export const TWOFA_V1_PACKAGE_NAME = "twofa.v1"; + +export interface TwoFaServiceClient { + verify2Fa(request: Verify2FaRequest, metadata?: Metadata): Observable; + + getTwoFaStatus(request: GetTwoFaStatusRequest, metadata?: Metadata): Observable; + + startTotpEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): Observable; + + confirmTotpErollment( + request: ConfirmTotpEnrollmentRequest, + metadata?: Metadata, + ): Observable; + + cancelTotpEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): Observable; + + disableTotp(request: DisableTotpRequest, metadata?: Metadata): Observable; + + startTelegramEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): Observable; + + confirmTelegramEnrollment( + request: ConfirmTelegramEnrollmentRequest, + metadata?: Metadata, + ): Observable; + + disableTelegram(request: DisableTelegramRequest, metadata?: Metadata): Observable; +} + +export interface TwoFaServiceController { + verify2Fa( + request: Verify2FaRequest, + metadata?: Metadata, + ): Promise | Observable | Verify2FaResponse; + + getTwoFaStatus( + request: GetTwoFaStatusRequest, + metadata?: Metadata, + ): Promise | Observable | GetTwoFaStatusResponse; + + startTotpEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): Promise | Observable | StartTotpEnrollmentResponse; + + confirmTotpErollment( + request: ConfirmTotpEnrollmentRequest, + metadata?: Metadata, + ): Promise | Observable | ConfirmTotpEnrollmentResponse; + + cancelTotpEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): Promise | Observable | CancelTotpEnrollmentResponse; + + disableTotp( + request: DisableTotpRequest, + metadata?: Metadata, + ): Promise | Observable | DisableTotpResponse; + + startTelegramEnrollment( + request: AuthenticatedAccessRequest, + metadata?: Metadata, + ): + | Promise + | Observable + | StartTelegramEnrollmentResponse; + + confirmTelegramEnrollment( + request: ConfirmTelegramEnrollmentRequest, + metadata?: Metadata, + ): + | Promise + | Observable + | ConfirmTelegramEnrollmentResponse; + + disableTelegram( + request: DisableTelegramRequest, + metadata?: Metadata, + ): Promise | Observable | DisableTelegramResponse; +} + +export function TwoFaServiceControllerMethods() { + return function (constructor: Function) { + const grpcMethods: string[] = [ + "verify2Fa", + "getTwoFaStatus", + "startTotpEnrollment", + "confirmTotpErollment", + "cancelTotpEnrollment", + "disableTotp", + "startTelegramEnrollment", + "confirmTelegramEnrollment", + "disableTelegram", + ]; + for (const method of grpcMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); + } + const grpcStreamMethods: string[] = []; + for (const method of grpcStreamMethods) { + const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); + GrpcStreamMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); + } + }; +} + +export const TWO_FA_SERVICE_NAME = "TwoFaService";