Compare commits
15 Commits
v1.0.32
...
a996973c97
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a996973c97 | ||
|
|
b7cd9c1434 | ||
|
|
7e1b70125a | ||
|
|
cbc0bf9154 | ||
|
|
7bb94f817b | ||
|
|
976b655ff2 | ||
|
|
641e2277d0 | ||
|
|
44c1cfb80a | ||
|
|
482ffdd386 | ||
|
|
0de3225481 | ||
|
|
8cbc2f86b3 | ||
|
|
47e9aa47b9 | ||
|
|
3a38e5f06c | ||
|
|
97a6e14a77 | ||
|
|
e4b4a30664 |
@@ -9,14 +9,7 @@ import type { Metadata } from "@grpc/grpc-js";
|
|||||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
export const protobufPackage = "account";
|
export const protobufPackage = "account.v1";
|
||||||
|
|
||||||
export enum Presence {
|
|
||||||
PRESENCE_UNSPECIFIED = 0,
|
|
||||||
OFFLINE = 1,
|
|
||||||
ONLINE = 2,
|
|
||||||
UNRECOGNIZED = -1,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetAccountRequest {
|
export interface GetAccountRequest {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -33,7 +26,7 @@ export interface GetAccountResponse {
|
|||||||
roles: string[];
|
roles: string[];
|
||||||
avatarUrl: string;
|
avatarUrl: string;
|
||||||
employeeId?: string | undefined;
|
employeeId?: string | undefined;
|
||||||
presence: Presence;
|
presence: string;
|
||||||
lastActive: string;
|
lastActive: string;
|
||||||
customStatusText: string;
|
customStatusText: string;
|
||||||
customStatusEmoji: string;
|
customStatusEmoji: string;
|
||||||
@@ -43,7 +36,7 @@ export interface GetAccountResponse {
|
|||||||
hasPin: boolean;
|
hasPin: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ACCOUNT_PACKAGE_NAME = "account";
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
||||||
|
|
||||||
export interface AccountServiceClient {
|
export interface AccountServiceClient {
|
||||||
getAccount(request: GetAccountRequest, metadata?: Metadata): Observable<GetAccountResponse>;
|
getAccount(request: GetAccountRequest, metadata?: Metadata): Observable<GetAccountResponse>;
|
||||||
|
|||||||
@@ -21,55 +21,6 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
type Presence int32
|
|
||||||
|
|
||||||
const (
|
|
||||||
Presence_PRESENCE_UNSPECIFIED Presence = 0
|
|
||||||
Presence_OFFLINE Presence = 1
|
|
||||||
Presence_ONLINE Presence = 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// Enum value maps for Presence.
|
|
||||||
var (
|
|
||||||
Presence_name = map[int32]string{
|
|
||||||
0: "PRESENCE_UNSPECIFIED",
|
|
||||||
1: "OFFLINE",
|
|
||||||
2: "ONLINE",
|
|
||||||
}
|
|
||||||
Presence_value = map[string]int32{
|
|
||||||
"PRESENCE_UNSPECIFIED": 0,
|
|
||||||
"OFFLINE": 1,
|
|
||||||
"ONLINE": 2,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func (x Presence) Enum() *Presence {
|
|
||||||
p := new(Presence)
|
|
||||||
*p = x
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x Presence) String() string {
|
|
||||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (Presence) Descriptor() protoreflect.EnumDescriptor {
|
|
||||||
return file_account_proto_enumTypes[0].Descriptor()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (Presence) Type() protoreflect.EnumType {
|
|
||||||
return &file_account_proto_enumTypes[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x Presence) Number() protoreflect.EnumNumber {
|
|
||||||
return protoreflect.EnumNumber(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use Presence.Descriptor instead.
|
|
||||||
func (Presence) EnumDescriptor() ([]byte, []int) {
|
|
||||||
return file_account_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetAccountRequest struct {
|
type GetAccountRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
@@ -126,7 +77,7 @@ type GetAccountResponse struct {
|
|||||||
Roles []string `protobuf:"bytes,8,rep,name=roles,proto3" json:"roles,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"`
|
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"`
|
EmployeeId *string `protobuf:"bytes,10,opt,name=employee_id,json=employeeId,proto3,oneof" json:"employee_id,omitempty"`
|
||||||
Presence Presence `protobuf:"varint,11,opt,name=presence,proto3,enum=account.Presence" json:"presence,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"`
|
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"`
|
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"`
|
CustomStatusEmoji string `protobuf:"bytes,14,opt,name=custom_status_emoji,json=customStatusEmoji,proto3" json:"custom_status_emoji,omitempty"`
|
||||||
@@ -238,11 +189,11 @@ func (x *GetAccountResponse) GetEmployeeId() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetAccountResponse) GetPresence() Presence {
|
func (x *GetAccountResponse) GetPresence() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Presence
|
return x.Presence
|
||||||
}
|
}
|
||||||
return Presence_PRESENCE_UNSPECIFIED
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *GetAccountResponse) GetLastActive() string {
|
func (x *GetAccountResponse) GetLastActive() string {
|
||||||
@@ -298,9 +249,10 @@ var File_account_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
const file_account_proto_rawDesc = "" +
|
const file_account_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\raccount.proto\x12\aaccount\"#\n" +
|
"\raccount.proto\x12\n" +
|
||||||
|
"account.v1\"#\n" +
|
||||||
"\x11GetAccountRequest\x12\x0e\n" +
|
"\x11GetAccountRequest\x12\x0e\n" +
|
||||||
"\x02id\x18\x01 \x01(\tR\x02id\"\xca\x04\n" +
|
"\x02id\x18\x01 \x01(\tR\x02id\"\xb7\x04\n" +
|
||||||
"\x12GetAccountResponse\x12\x0e\n" +
|
"\x12GetAccountResponse\x12\x0e\n" +
|
||||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" +
|
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" +
|
||||||
"\busername\x18\x02 \x01(\tR\busername\x12\x14\n" +
|
"\busername\x18\x02 \x01(\tR\busername\x12\x14\n" +
|
||||||
@@ -314,8 +266,8 @@ const file_account_proto_rawDesc = "" +
|
|||||||
"avatar_url\x18\t \x01(\tR\tavatarUrl\x12$\n" +
|
"avatar_url\x18\t \x01(\tR\tavatarUrl\x12$\n" +
|
||||||
"\vemployee_id\x18\n" +
|
"\vemployee_id\x18\n" +
|
||||||
" \x01(\tH\x00R\n" +
|
" \x01(\tH\x00R\n" +
|
||||||
"employeeId\x88\x01\x01\x12-\n" +
|
"employeeId\x88\x01\x01\x12\x1a\n" +
|
||||||
"\bpresence\x18\v \x01(\x0e2\x11.account.PresenceR\bpresence\x12\x1f\n" +
|
"\bpresence\x18\v \x01(\tR\bpresence\x12\x1f\n" +
|
||||||
"\vlast_active\x18\f \x01(\tR\n" +
|
"\vlast_active\x18\f \x01(\tR\n" +
|
||||||
"lastActive\x12,\n" +
|
"lastActive\x12,\n" +
|
||||||
"\x12custom_status_text\x18\r \x01(\tR\x10customStatusText\x12.\n" +
|
"\x12custom_status_text\x18\r \x01(\tR\x10customStatusText\x12.\n" +
|
||||||
@@ -324,15 +276,10 @@ const file_account_proto_rawDesc = "" +
|
|||||||
"\blanguage\x18\x10 \x01(\tR\blanguage\x12$\n" +
|
"\blanguage\x18\x10 \x01(\tR\blanguage\x12$\n" +
|
||||||
"\x0etwo_fa_enabled\x18\x11 \x01(\bR\ftwoFaEnabled\x12\x17\n" +
|
"\x0etwo_fa_enabled\x18\x11 \x01(\bR\ftwoFaEnabled\x12\x17\n" +
|
||||||
"\ahas_pin\x18\x12 \x01(\bR\x06hasPinB\x0e\n" +
|
"\ahas_pin\x18\x12 \x01(\bR\x06hasPinB\x0e\n" +
|
||||||
"\f_employee_id*=\n" +
|
"\f_employee_id2]\n" +
|
||||||
"\bPresence\x12\x18\n" +
|
"\x0eAccountService\x12K\n" +
|
||||||
"\x14PRESENCE_UNSPECIFIED\x10\x00\x12\v\n" +
|
|
||||||
"\aOFFLINE\x10\x01\x12\n" +
|
|
||||||
"\n" +
|
"\n" +
|
||||||
"\x06ONLINE\x10\x022W\n" +
|
"GetAccount\x12\x1d.account.v1.GetAccountRequest\x1a\x1e.account.v1.GetAccountResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||||
"\x0eAccountService\x12E\n" +
|
|
||||||
"\n" +
|
|
||||||
"GetAccount\x12\x1a.account.GetAccountRequest\x1a\x1b.account.GetAccountResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
file_account_proto_rawDescOnce sync.Once
|
file_account_proto_rawDescOnce sync.Once
|
||||||
@@ -346,22 +293,19 @@ func file_account_proto_rawDescGZIP() []byte {
|
|||||||
return file_account_proto_rawDescData
|
return file_account_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_account_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
|
||||||
var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_account_proto_goTypes = []any{
|
var file_account_proto_goTypes = []any{
|
||||||
(Presence)(0), // 0: account.Presence
|
(*GetAccountRequest)(nil), // 0: account.v1.GetAccountRequest
|
||||||
(*GetAccountRequest)(nil), // 1: account.GetAccountRequest
|
(*GetAccountResponse)(nil), // 1: account.v1.GetAccountResponse
|
||||||
(*GetAccountResponse)(nil), // 2: account.GetAccountResponse
|
|
||||||
}
|
}
|
||||||
var file_account_proto_depIdxs = []int32{
|
var file_account_proto_depIdxs = []int32{
|
||||||
0, // 0: account.GetAccountResponse.presence:type_name -> account.Presence
|
0, // 0: account.v1.AccountService.GetAccount:input_type -> account.v1.GetAccountRequest
|
||||||
1, // 1: account.AccountService.GetAccount:input_type -> account.GetAccountRequest
|
1, // 1: account.v1.AccountService.GetAccount:output_type -> account.v1.GetAccountResponse
|
||||||
2, // 2: account.AccountService.GetAccount:output_type -> account.GetAccountResponse
|
1, // [1:2] is the sub-list for method output_type
|
||||||
2, // [2:3] is the sub-list for method output_type
|
0, // [0:1] is the sub-list for method input_type
|
||||||
1, // [1:2] is the sub-list for method input_type
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
1, // [1:1] is the sub-list for extension type_name
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
1, // [1:1] is the sub-list for extension extendee
|
0, // [0:0] is the sub-list for field type_name
|
||||||
0, // [0:1] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_account_proto_init() }
|
func init() { file_account_proto_init() }
|
||||||
@@ -375,14 +319,13 @@ func file_account_proto_init() {
|
|||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)),
|
||||||
NumEnums: 1,
|
NumEnums: 0,
|
||||||
NumMessages: 2,
|
NumMessages: 2,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
GoTypes: file_account_proto_goTypes,
|
GoTypes: file_account_proto_goTypes,
|
||||||
DependencyIndexes: file_account_proto_depIdxs,
|
DependencyIndexes: file_account_proto_depIdxs,
|
||||||
EnumInfos: file_account_proto_enumTypes,
|
|
||||||
MessageInfos: file_account_proto_msgTypes,
|
MessageInfos: file_account_proto_msgTypes,
|
||||||
}.Build()
|
}.Build()
|
||||||
File_account_proto = out.File
|
File_account_proto = out.File
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
const _ = grpc.SupportPackageIsVersion9
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AccountService_GetAccount_FullMethodName = "/account.AccountService/GetAccount"
|
AccountService_GetAccount_FullMethodName = "/account.v1.AccountService/GetAccount"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AccountServiceClient is the client API for AccountService service.
|
// AccountServiceClient is the client API for AccountService service.
|
||||||
@@ -108,7 +108,7 @@ func _AccountService_GetAccount_Handler(srv interface{}, ctx context.Context, de
|
|||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "account.AccountService",
|
ServiceName: "account.v1.AccountService",
|
||||||
HandlerType: (*AccountServiceServer)(nil),
|
HandlerType: (*AccountServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,107 +21,6 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Полная модель пользователя
|
|
||||||
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"` // Статус аккаунта
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *UserData) Reset() {
|
|
||||||
*x = UserData{}
|
|
||||||
mi := &file_ldap_auth_proto_msgTypes[0]
|
|
||||||
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_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 UserData.ProtoReflect.Descriptor instead.
|
|
||||||
func (*UserData) Descriptor() ([]byte, []int) {
|
|
||||||
return file_ldap_auth_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Авторизация ---
|
// --- Авторизация ---
|
||||||
type VerifyRequest struct {
|
type VerifyRequest struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
@@ -133,7 +32,7 @@ type VerifyRequest struct {
|
|||||||
|
|
||||||
func (x *VerifyRequest) Reset() {
|
func (x *VerifyRequest) Reset() {
|
||||||
*x = VerifyRequest{}
|
*x = VerifyRequest{}
|
||||||
mi := &file_ldap_auth_proto_msgTypes[1]
|
mi := &file_ldap_auth_proto_msgTypes[0]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -145,7 +44,7 @@ func (x *VerifyRequest) String() string {
|
|||||||
func (*VerifyRequest) ProtoMessage() {}
|
func (*VerifyRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *VerifyRequest) ProtoReflect() protoreflect.Message {
|
func (x *VerifyRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_ldap_auth_proto_msgTypes[1]
|
mi := &file_ldap_auth_proto_msgTypes[0]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -158,7 +57,7 @@ func (x *VerifyRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*VerifyRequest) Descriptor() ([]byte, []int) {
|
func (*VerifyRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_ldap_auth_proto_rawDescGZIP(), []int{1}
|
return file_ldap_auth_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *VerifyRequest) GetUsername() string {
|
func (x *VerifyRequest) GetUsername() string {
|
||||||
@@ -186,7 +85,7 @@ type VerifyResponse struct {
|
|||||||
|
|
||||||
func (x *VerifyResponse) Reset() {
|
func (x *VerifyResponse) Reset() {
|
||||||
*x = VerifyResponse{}
|
*x = VerifyResponse{}
|
||||||
mi := &file_ldap_auth_proto_msgTypes[2]
|
mi := &file_ldap_auth_proto_msgTypes[1]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -198,7 +97,7 @@ func (x *VerifyResponse) String() string {
|
|||||||
func (*VerifyResponse) ProtoMessage() {}
|
func (*VerifyResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *VerifyResponse) ProtoReflect() protoreflect.Message {
|
func (x *VerifyResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_ldap_auth_proto_msgTypes[2]
|
mi := &file_ldap_auth_proto_msgTypes[1]
|
||||||
if x != nil {
|
if x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -211,7 +110,7 @@ func (x *VerifyResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*VerifyResponse) Descriptor() ([]byte, []int) {
|
func (*VerifyResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_ldap_auth_proto_rawDescGZIP(), []int{2}
|
return file_ldap_auth_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *VerifyResponse) GetSuccess() bool {
|
func (x *VerifyResponse) GetSuccess() bool {
|
||||||
@@ -239,23 +138,15 @@ var File_ldap_auth_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
const file_ldap_auth_proto_rawDesc = "" +
|
const file_ldap_auth_proto_rawDesc = "" +
|
||||||
"\n" +
|
"\n" +
|
||||||
"\x0fldap-auth.proto\x12\fldap_auth.v1\"\xde\x01\n" +
|
"\x0fldap-auth.proto\x12\fldap_auth.v1\x1a\n" +
|
||||||
"\bUserData\x12\x0e\n" +
|
"ldap.proto\"G\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\"G\n" +
|
|
||||||
"\rVerifyRequest\x12\x1a\n" +
|
"\rVerifyRequest\x12\x1a\n" +
|
||||||
"\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
|
"\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
|
||||||
"\bpassword\x18\x02 \x01(\tR\bpassword\"{\n" +
|
"\bpassword\x18\x02 \x01(\tR\bpassword\"v\n" +
|
||||||
"\x0eVerifyResponse\x12\x18\n" +
|
"\x0eVerifyResponse\x12\x18\n" +
|
||||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" +
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" +
|
||||||
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12*\n" +
|
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12%\n" +
|
||||||
"\x04user\x18\x03 \x01(\v2\x16.ldap_auth.v1.UserDataR\x04user2Z\n" +
|
"\x04user\x18\x03 \x01(\v2\x11.ldap.v1.UserDataR\x04user2Z\n" +
|
||||||
"\x0fLdapAuthService\x12G\n" +
|
"\x0fLdapAuthService\x12G\n" +
|
||||||
"\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"
|
"VerifyUser\x12\x1b.ldap_auth.v1.VerifyRequest\x1a\x1c.ldap_auth.v1.VerifyResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||||
@@ -272,16 +163,16 @@ func file_ldap_auth_proto_rawDescGZIP() []byte {
|
|||||||
return file_ldap_auth_proto_rawDescData
|
return file_ldap_auth_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_ldap_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_ldap_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_ldap_auth_proto_goTypes = []any{
|
var file_ldap_auth_proto_goTypes = []any{
|
||||||
(*UserData)(nil), // 0: ldap_auth.v1.UserData
|
(*VerifyRequest)(nil), // 0: ldap_auth.v1.VerifyRequest
|
||||||
(*VerifyRequest)(nil), // 1: ldap_auth.v1.VerifyRequest
|
(*VerifyResponse)(nil), // 1: ldap_auth.v1.VerifyResponse
|
||||||
(*VerifyResponse)(nil), // 2: ldap_auth.v1.VerifyResponse
|
(*UserData)(nil), // 2: ldap.v1.UserData
|
||||||
}
|
}
|
||||||
var file_ldap_auth_proto_depIdxs = []int32{
|
var file_ldap_auth_proto_depIdxs = []int32{
|
||||||
0, // 0: ldap_auth.v1.VerifyResponse.user:type_name -> ldap_auth.v1.UserData
|
2, // 0: ldap_auth.v1.VerifyResponse.user:type_name -> ldap.v1.UserData
|
||||||
1, // 1: ldap_auth.v1.LdapAuthService.VerifyUser:input_type -> ldap_auth.v1.VerifyRequest
|
0, // 1: ldap_auth.v1.LdapAuthService.VerifyUser:input_type -> ldap_auth.v1.VerifyRequest
|
||||||
2, // 2: ldap_auth.v1.LdapAuthService.VerifyUser:output_type -> ldap_auth.v1.VerifyResponse
|
1, // 2: ldap_auth.v1.LdapAuthService.VerifyUser:output_type -> ldap_auth.v1.VerifyResponse
|
||||||
2, // [2:3] is the sub-list for method output_type
|
2, // [2:3] is the sub-list for method output_type
|
||||||
1, // [1:2] is the sub-list for method input_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 type_name
|
||||||
@@ -294,13 +185,14 @@ func file_ldap_auth_proto_init() {
|
|||||||
if File_ldap_auth_proto != nil {
|
if File_ldap_auth_proto != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
file_ldap_proto_init()
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ldap_auth_proto_rawDesc), len(file_ldap_auth_proto_rawDesc)),
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ldap_auth_proto_rawDesc), len(file_ldap_auth_proto_rawDesc)),
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 3,
|
NumMessages: 2,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ type UserData struct {
|
|||||||
Avatar []byte `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // Аватарка в байтах (thumbnailPhoto)
|
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"` // Список групп
|
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"` // Статус аккаунта
|
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
|
unknownFields protoimpl.UnknownFields
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
}
|
}
|
||||||
@@ -214,6 +215,13 @@ func (x *UserData) GetIsActive() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *UserData) GetPhone() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Phone
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// Модель группы
|
// Модель группы
|
||||||
type GroupData struct {
|
type GroupData struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
@@ -700,7 +708,7 @@ const file_ldap_proto_rawDesc = "" +
|
|||||||
"\fEmptyRequest\"O\n" +
|
"\fEmptyRequest\"O\n" +
|
||||||
"\x0eStatusResponse\x12\x18\n" +
|
"\x0eStatusResponse\x12\x18\n" +
|
||||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" +
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" +
|
||||||
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xde\x01\n" +
|
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xf4\x01\n" +
|
||||||
"\bUserData\x12\x0e\n" +
|
"\bUserData\x12\x0e\n" +
|
||||||
"\x02dn\x18\x01 \x01(\tR\x02dn\x12\x1a\n" +
|
"\x02dn\x18\x01 \x01(\tR\x02dn\x12\x1a\n" +
|
||||||
"\busername\x18\x02 \x01(\tR\busername\x12!\n" +
|
"\busername\x18\x02 \x01(\tR\busername\x12!\n" +
|
||||||
@@ -709,7 +717,8 @@ const file_ldap_proto_rawDesc = "" +
|
|||||||
"\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" +
|
"\vdescription\x18\x05 \x01(\tR\vdescription\x12\x16\n" +
|
||||||
"\x06avatar\x18\x06 \x01(\fR\x06avatar\x12\x16\n" +
|
"\x06avatar\x18\x06 \x01(\fR\x06avatar\x12\x16\n" +
|
||||||
"\x06groups\x18\a \x03(\tR\x06groups\x12\x1b\n" +
|
"\x06groups\x18\a \x03(\tR\x06groups\x12\x1b\n" +
|
||||||
"\tis_active\x18\b \x01(\bR\bisActive\"/\n" +
|
"\tis_active\x18\b \x01(\bR\bisActive\x12\x14\n" +
|
||||||
|
"\x05phone\x18\t \x01(\tR\x05phone\"/\n" +
|
||||||
"\tGroupData\x12\x0e\n" +
|
"\tGroupData\x12\x0e\n" +
|
||||||
"\x02dn\x18\x01 \x01(\tR\x02dn\x12\x12\n" +
|
"\x02dn\x18\x01 \x01(\tR\x02dn\x12\x12\n" +
|
||||||
"\x04name\x18\x02 \x01(\tR\x04name\"z\n" +
|
"\x04name\x18\x02 \x01(\tR\x04name\"z\n" +
|
||||||
|
|||||||
@@ -8,29 +8,10 @@
|
|||||||
import type { Metadata } from "@grpc/grpc-js";
|
import type { Metadata } from "@grpc/grpc-js";
|
||||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
import { UserData } from "./ldap";
|
||||||
|
|
||||||
export const protobufPackage = "ldap_auth.v1";
|
export const protobufPackage = "ldap_auth.v1";
|
||||||
|
|
||||||
/** Полная модель пользователя */
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** --- Авторизация --- */
|
/** --- Авторизация --- */
|
||||||
export interface VerifyRequest {
|
export interface VerifyRequest {
|
||||||
username: string;
|
username: string;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export interface UserData {
|
|||||||
groups: string[];
|
groups: string[];
|
||||||
/** Статус аккаунта */
|
/** Статус аккаунта */
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
phone: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Модель группы */
|
/** Модель группы */
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lendry-erp/contracts",
|
"name": "@lendry-erp/contracts",
|
||||||
"version": "1.0.30",
|
"version": "1.0.38",
|
||||||
"description": "Protobuf definitions and generated TypeScript types",
|
"description": "Protobuf definitions and generated TypeScript types",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
package account;
|
package account.v1;
|
||||||
|
|
||||||
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
|
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ message GetAccountResponse {
|
|||||||
repeated string roles = 8;
|
repeated string roles = 8;
|
||||||
string avatar_url = 9;
|
string avatar_url = 9;
|
||||||
optional string employee_id = 10;
|
optional string employee_id = 10;
|
||||||
Presence presence = 11;
|
string presence = 11;
|
||||||
string last_active = 12;
|
string last_active = 12;
|
||||||
string custom_status_text = 13;
|
string custom_status_text = 13;
|
||||||
string custom_status_emoji = 14;
|
string custom_status_emoji = 14;
|
||||||
@@ -33,9 +33,4 @@ message GetAccountResponse {
|
|||||||
bool has_pin = 18;
|
bool has_pin = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Presence {
|
|
||||||
PRESENCE_UNSPECIFIED = 0;
|
|
||||||
OFFLINE = 1;
|
|
||||||
ONLINE = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ message UserData {
|
|||||||
bytes avatar = 6; // Аватарка в байтах (thumbnailPhoto)
|
bytes avatar = 6; // Аватарка в байтах (thumbnailPhoto)
|
||||||
repeated string groups = 7; // Список групп
|
repeated string groups = 7; // Список групп
|
||||||
bool is_active = 8; // Статус аккаунта
|
bool is_active = 8; // Статус аккаунта
|
||||||
|
string phone = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Модель группы
|
// Модель группы
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
export const PROTO_PATHS = {
|
export const PROTO_PATHS = {
|
||||||
AUTH: join(__dirname, "../../proto/identity.proto"),
|
AUTH: join(__dirname, "../../proto/auth.proto"),
|
||||||
|
LDAP_AUTH: join(__dirname, "../../proto/ldap-auth.proto"),
|
||||||
|
ACCOUNT: join(__dirname, "../../proto/account.proto"),
|
||||||
|
TWOFA: join(__dirname, "../../proto/twofa.proto"),
|
||||||
LDAP: join(__dirname, "../../proto/ldap.proto"),
|
LDAP: join(__dirname, "../../proto/ldap.proto"),
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user