Files
contracts/proto/sso/account.proto
Дмитрий 59d4d442b2
Some checks failed
Publish / Publish Job (push) Failing after 2m29s
upgrede: add asign role and manege roles and permissions
2026-04-09 17:04:13 +03:00

167 lines
3.6 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
syntax = "proto3";
package account.v1;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
service AccountService {
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse);
rpc AdminResetPassword (AdminResetPasswordRequest) returns (AdminResetPasswordResponse);
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
rpc ChangeData(ChangeDataRequest) returns (ChangeDataResponse);
rpc AssignRole (AssignRoleRequest) returns (AssignRoleResponse);
rpc RevokeRole (RevokeRoleRequest) returns (RevokeRoleResponse);
rpc SetPin (SetPinRequest) returns (SetPinResponse);
rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse);
rpc GetPinStatus (GetPinStatusRequest) returns (GetPinStatusResponse);
rpc RemovePin (RemovePinRequest) returns (RemovePinResponse);
}
message GetAccountRequest {
string id = 1;
}
message GetAccountResponse {
string id = 1;
string username = 2;
string email = 3;
string phone = 4;
string full_name = 5;
bool is_ldap = 6;
string status = 7;
repeated string roles = 8;
string avatar_url = 9;
optional string employee_id = 10;
string presence = 11;
string last_active = 12;
string custom_status_text = 13;
string custom_status_emoji = 14;
string timezone = 15;
string language = 16;
bool two_fa_enabled = 17;
bool has_pin = 18;
}
message ChangePasswordRequest {
string user_id = 1;
string old_password = 3;
string new_password = 4;
optional string code = 5;
string session_id = 6;
}
message ChangePasswordResponse {
bool success = 1;
string message = 2;
}
message CreateUserRequest {
string username = 1;
string password = 2;
repeated string roles = 3;
}
message CreateUserResponse {
bool success = 1;
string message = 2;
}
message DeleteUserRequest {
string user_id = 1;
}
message DeleteUserResponse {
bool success = 1;
string message = 2;
}
message ChangeDataRequest {
string user_id = 1;
string session_id = 2;
optional string email = 3;
optional string phone = 4;
optional string full_name = 5;
optional string avatar_url = 6;
optional string custom_status_text = 7;
optional string custom_status_emoji = 8;
optional string timezone = 9;
optional string language = 10;
}
message ChangeDataResponse {
bool success = 1;
string message = 2;
}
message AssignRoleRequest {
string user_id = 1;
string role_id = 2; // В gRPC передаем как string, внутри преобразуем в Int
}
message AssignRoleResponse {
bool success = 1;
string message = 2;
}
message RevokeRoleRequest {
string user_id = 1;
string role_id = 2;
}
message RevokeRoleResponse {
bool success = 1;
string message = 2;
}
message AdminResetPasswordRequest {
string user_id = 1;
string new_password = 2;
}
message AdminResetPasswordResponse {
bool success = 1;
string message = 2;
}
message SetPinRequest {
string user_id = 1;
string session_id = 2;
string pin = 3;
}
message SetPinResponse {
bool success = 1;
string message = 2;
}
message UnlockPinRequest {
string user_id = 1;
string session_id = 2;
string pin = 3;
}
message UnlockPinResponse {
bool success = 1;
string message = 2;
}
message GetPinStatusRequest {
string user_id = 1;
string session_id = 2;
}
message GetPinStatusResponse {
bool has_pin = 1;
bool is_locked = 2;
string lock_until = 3;
}
message RemovePinRequest {
string pin = 1;
string user_id = 2;
string session_id=3;
}
message RemovePinResponse {
bool success = 1;
string message = 2;
}