8 Commits

Author SHA1 Message Date
Дмитрий
0713605442 update: ldap.proto
All checks were successful
Publish / Publish Job (push) Successful in 2m27s
2026-04-01 12:10:00 +03:00
Дмитрий
156a747f59 fix: change version and go.mod file
All checks were successful
Publish / Publish Job (push) Successful in 2m27s
2026-04-01 11:08:41 +03:00
Дмитрий
ff14fded40 fix: change version
All checks were successful
Publish / Publish Job (push) Successful in 2m32s
2026-04-01 10:50:42 +03:00
github-actions[bot]
7f07e83065 chore: auto-generate protobuf files [skip ci] 2026-04-01 07:38:33 +00:00
Дмитрий
b5d2f846ee change: change go_packege ldap-service
Some checks failed
Publish / Publish Job (push) Failing after 2m27s
2026-04-01 10:36:07 +03:00
github-actions[bot]
b4ff48f512 chore: auto-generate protobuf files [skip ci] 2026-03-30 16:54:45 +00:00
Дмитрий
55fad6f1b2 fix: fix go_package
All checks were successful
Publish / Publish Job (push) Successful in 2m29s
2026-03-30 19:52:10 +03:00
github-actions[bot]
ea99c4c89a chore: auto-generate protobuf files [skip ci] 2026-03-30 16:08:03 +00:00
4 changed files with 99 additions and 11 deletions

View File

@@ -221,7 +221,7 @@ const file_ldap_proto_rawDesc = "" +
"\tis_active\x18\x04 \x01(\bR\bisActive2S\n" +
"\bLdapAuth\x12G\n" +
"\n" +
"VerifyUser\x12\x1b.ldap_service.VerifyRequest\x1a\x1c.ldap_service.VerifyResponseB+Z)git.lendry.ru/lendry-erp/gen;ldap_serviceb\x06proto3"
"VerifyUser\x12\x1b.ldap_service.VerifyRequest\x1a\x1c.ldap_service.VerifyResponseB<Z:git.lendry.ru/lendry-erp/contracts.git/gen/go;ldap_serviceb\x06proto3"
var (
file_ldap_proto_rawDescOnce sync.Once

2
go.mod
View File

@@ -1,3 +1,3 @@
module git.lendry.ru/lendry-erp/proto
module git.lendry.ru/lendry-erp/contracts.git
go 1.26.1

View File

@@ -1,6 +1,6 @@
{
"name": "@lendry-erp/contracts",
"version": "1.0.16",
"version": "1.0.20",
"description": "Protobuf definitions and generated TypeScript types",
"type": "commonjs",
"main": "./dist/index.js",

View File

@@ -2,12 +2,62 @@ syntax = "proto3";
package ldap_service;
option go_package = "git.lendry.ru/lendry-erp/contracts.git/ldap-service/v1;ldap_service";
option go_package = "git.lendry.ru/lendry-erp/contracts.git/gen/go;ldap_service";
// ==========================================
// ГЛАВНЫЙ СЕРВИС
// ==========================================
service LdapAuth {
rpc VerifyUser (VerifyRequest) returns (VerifyResponse);
// --- Вектор 1: Авторизация (Bind от имени пользователя) ---
rpc VerifyUser (VerifyRequest) returns (VerifyResponse);
// --- Вектор 2: Управление Пользователями (Bind системного аккаунта) ---
rpc GetUsers (EmptyRequest) returns (UserListResponse);
rpc CreateUser (CreateUserRequest) returns (StatusResponse);
rpc UpdateUser (UpdateUserRequest) returns (StatusResponse);
rpc ChangePassword (ChangePasswordRequest) returns (StatusResponse);
rpc ToggleUserStatus (ToggleStatusRequest) returns (StatusResponse);
// --- Вектор 3: Управление Группами ---
rpc GetGroups (EmptyRequest) returns (GroupListResponse);
rpc AddUserToGroup (GroupMemberRequest) returns (StatusResponse);
rpc RemoveUserFromGroup (GroupMemberRequest) returns (StatusResponse);
}
// ==========================================
// БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ
// ==========================================
message EmptyRequest {}
// Стандартный ответ для мутаций (создание, обновление, удаление)
message StatusResponse {
bool success = 1;
string error_message = 2;
}
// Полная модель пользователя
message UserData {
string dn = 1; // Полный путь в AD (Distinguished Name)
string username = 2; // Логин (sAMAccountName)
string display_name = 3; // ФИО (displayName)
string email = 4; // Почта (mail)
string description = 5; // Описание/Должность (description)
bytes avatar = 6; // Аватарка в байтах (thumbnailPhoto)
repeated string groups = 7; // Список групп
bool is_active = 8; // Статус аккаунта
}
// Модель группы
message GroupData {
string dn = 1;
string name = 2; // Короткое имя группы (cn)
}
// ==========================================
// ЗАПРОСЫ И ОТВЕТЫ (REQUESTS / RESPONSES)
// ==========================================
// --- Авторизация ---
message VerifyRequest {
string username = 1;
string password = 2;
@@ -16,13 +66,51 @@ message VerifyRequest {
message VerifyResponse {
bool success = 1;
string error_message = 2;
UserData user = 3;
UserData user = 3; // Отдаем полные данные при успешном входе
}
message UserData {
string dn = 1;
string display_name = 2;
repeated string groups = 3;
bool is_active = 4;
// --- Списки ---
message UserListResponse {
bool success = 1;
string error_message = 2;
repeated UserData users = 3;
}
message GroupListResponse {
bool success = 1;
string error_message = 2;
repeated GroupData groups = 3;
}
// --- Управление профилем ---
message CreateUserRequest {
string username = 1;
string full_name = 2;
string password = 3;
optional string email = 4; // Сразу при создании можно задать почту
}
// Запрос на обновление. Используем optional для частичного обновления.
message UpdateUserRequest {
string username = 1; // Обязательное поле: кого обновляем
optional string display_name = 2; // Новое ФИО (повлечет Rename CN)
optional string email = 3; // Новая почта
optional string description = 4; // Новое описание
optional bytes avatar = 5; // Новая аватарка (бинарник картинки)
}
message ChangePasswordRequest {
string username = 1;
string new_password = 2;
}
message ToggleStatusRequest {
string username = 1;
bool set_active = 2; // true - включить (512), false - отключить (514)
}
// --- Управление членством в группах ---
message GroupMemberRequest {
string username = 1; // Логин пользователя
string group_dn = 2; // Полный путь группы (в которую добавляем / из которой удаляем)
}