1 Commits

Author SHA1 Message Date
Дмитрий
82ddc7b227 fix: fix go_package 2026-03-30 19:51:40 +03:00
25 changed files with 1239 additions and 5183 deletions

View File

@@ -50,7 +50,7 @@ jobs:
npm install -g ts-proto npm install -g ts-proto
mkdir -p ./gen/go # Создаем вложенную папку для Go mkdir -p ./gen/go # Создаем вложенную папку для Go
protoc -I ./proto ./proto/*.proto \ protoc -I ./proto ./proto/*.proto \
--ts_proto_out=nestJs=true,addGrpcMetadata=true,package=omit:./gen \ --ts_proto_out=nestJs=true,package=omit:./gen \
--go_out=paths=source_relative:./gen/go \ --go_out=paths=source_relative:./gen/go \
--go-grpc_out=paths=source_relative:./gen/go --go-grpc_out=paths=source_relative:./gen/go

View File

@@ -1,159 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v3.21.12
// source: 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 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 const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
export interface AccountServiceClient {
getAccount(request: GetAccountRequest, metadata?: Metadata): Observable<GetAccountResponse>;
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<ChangePasswordResponse>;
setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>;
unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>;
getPinStatus(request: GetPinStatusRequest, metadata?: Metadata): Observable<GetPinStatusResponse>;
removePin(request: RemovePinRequest, metadata?: Metadata): Observable<RemovePinResponse>;
}
export interface AccountServiceController {
getAccount(
request: GetAccountRequest,
metadata?: Metadata,
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
changePassword(
request: ChangePasswordRequest,
metadata?: Metadata,
): Promise<ChangePasswordResponse> | Observable<ChangePasswordResponse> | ChangePasswordResponse;
setPin(
request: SetPinRequest,
metadata?: Metadata,
): Promise<SetPinResponse> | Observable<SetPinResponse> | SetPinResponse;
unlockPin(
request: UnlockPinRequest,
metadata?: Metadata,
): Promise<UnlockPinResponse> | Observable<UnlockPinResponse> | UnlockPinResponse;
getPinStatus(
request: GetPinStatusRequest,
metadata?: Metadata,
): Promise<GetPinStatusResponse> | Observable<GetPinStatusResponse> | GetPinStatusResponse;
removePin(
request: RemovePinRequest,
metadata?: Metadata,
): Promise<RemovePinResponse> | Observable<RemovePinResponse> | RemovePinResponse;
}
export function AccountServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ["getAccount", "changePassword", "setPin", "unlockPin", "getPinStatus", "removePin"];
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";

View File

@@ -1,189 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v3.21.12
// source: 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<LoginResponse>;
refresh(request: RefreshRequest, metadata?: Metadata): Observable<RefreshResponse>;
verifyToken(request: VerifyTokenRequest, metadata?: Metadata): Observable<VerifyTokenResponse>;
getAccountRoleLevel(
request: GetAccountRoleLevelRequest,
metadata?: Metadata,
): Observable<GetAccountRoleLevelResponse>;
logout(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
logoutOther(request: LogoutRequest, metadata?: Metadata): Observable<LogoutResponse>;
getSessions(request: GetSessionRequest, metadata?: Metadata): Observable<GetSessionsResponse>;
terminateSession(request: TerminateSessionRequest, metadata?: Metadata): Observable<TerminateSessionResponse>;
}
export interface AuthServiceController {
login(request: LoginRequest, metadata?: Metadata): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
refresh(
request: RefreshRequest,
metadata?: Metadata,
): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
verifyToken(
request: VerifyTokenRequest,
metadata?: Metadata,
): Promise<VerifyTokenResponse> | Observable<VerifyTokenResponse> | VerifyTokenResponse;
getAccountRoleLevel(
request: GetAccountRoleLevelRequest,
metadata?: Metadata,
): Promise<GetAccountRoleLevelResponse> | Observable<GetAccountRoleLevelResponse> | GetAccountRoleLevelResponse;
logout(
request: LogoutRequest,
metadata?: Metadata,
): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
logoutOther(
request: LogoutRequest,
metadata?: Metadata,
): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
getSessions(
request: GetSessionRequest,
metadata?: Metadata,
): Promise<GetSessionsResponse> | Observable<GetSessionsResponse> | GetSessionsResponse;
terminateSession(
request: TerminateSessionRequest,
metadata?: Metadata,
): Promise<TerminateSessionResponse> | Observable<TerminateSessionResponse> | 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";

View File

@@ -1,980 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v3.21.12
// source: 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_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_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_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_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_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_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_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_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_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_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_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_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 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_account_proto_msgTypes[4]
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_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 SetPinRequest.ProtoReflect.Descriptor instead.
func (*SetPinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{4}
}
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_account_proto_msgTypes[5]
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_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 SetPinResponse.ProtoReflect.Descriptor instead.
func (*SetPinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{5}
}
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_account_proto_msgTypes[6]
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_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 UnlockPinRequest.ProtoReflect.Descriptor instead.
func (*UnlockPinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{6}
}
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_account_proto_msgTypes[7]
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_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 UnlockPinResponse.ProtoReflect.Descriptor instead.
func (*UnlockPinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{7}
}
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_account_proto_msgTypes[8]
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_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 GetPinStatusRequest.ProtoReflect.Descriptor instead.
func (*GetPinStatusRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{8}
}
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_account_proto_msgTypes[9]
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_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 GetPinStatusResponse.ProtoReflect.Descriptor instead.
func (*GetPinStatusResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{9}
}
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_account_proto_msgTypes[10]
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_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 RemovePinRequest.ProtoReflect.Descriptor instead.
func (*RemovePinRequest) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{10}
}
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_account_proto_msgTypes[11]
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_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 RemovePinResponse.ProtoReflect.Descriptor instead.
func (*RemovePinResponse) Descriptor() ([]byte, []int) {
return file_account_proto_rawDescGZIP(), []int{11}
}
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 ""
}
var File_account_proto protoreflect.FileDescriptor
const file_account_proto_rawDesc = "" +
"\n" +
"\raccount.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\"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\amessage2\xde\x03\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\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.RemovePinResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
var (
file_account_proto_rawDescOnce sync.Once
file_account_proto_rawDescData []byte
)
func file_account_proto_rawDescGZIP() []byte {
file_account_proto_rawDescOnce.Do(func() {
file_account_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)))
})
return file_account_proto_rawDescData
}
var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_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
(*SetPinRequest)(nil), // 4: account.v1.SetPinRequest
(*SetPinResponse)(nil), // 5: account.v1.SetPinResponse
(*UnlockPinRequest)(nil), // 6: account.v1.UnlockPinRequest
(*UnlockPinResponse)(nil), // 7: account.v1.UnlockPinResponse
(*GetPinStatusRequest)(nil), // 8: account.v1.GetPinStatusRequest
(*GetPinStatusResponse)(nil), // 9: account.v1.GetPinStatusResponse
(*RemovePinRequest)(nil), // 10: account.v1.RemovePinRequest
(*RemovePinResponse)(nil), // 11: account.v1.RemovePinResponse
}
var file_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
4, // 2: account.v1.AccountService.SetPin:input_type -> account.v1.SetPinRequest
6, // 3: account.v1.AccountService.UnlockPin:input_type -> account.v1.UnlockPinRequest
8, // 4: account.v1.AccountService.GetPinStatus:input_type -> account.v1.GetPinStatusRequest
10, // 5: account.v1.AccountService.RemovePin:input_type -> account.v1.RemovePinRequest
1, // 6: account.v1.AccountService.GetAccount:output_type -> account.v1.GetAccountResponse
3, // 7: account.v1.AccountService.ChangePassword:output_type -> account.v1.ChangePasswordResponse
5, // 8: account.v1.AccountService.SetPin:output_type -> account.v1.SetPinResponse
7, // 9: account.v1.AccountService.UnlockPin:output_type -> account.v1.UnlockPinResponse
9, // 10: account.v1.AccountService.GetPinStatus:output_type -> account.v1.GetPinStatusResponse
11, // 11: account.v1.AccountService.RemovePin:output_type -> account.v1.RemovePinResponse
6, // [6:12] is the sub-list for method output_type
0, // [0:6] 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_account_proto_init() }
func file_account_proto_init() {
if File_account_proto != nil {
return
}
file_account_proto_msgTypes[1].OneofWrappers = []any{}
file_account_proto_msgTypes[2].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_account_proto_rawDesc), len(file_account_proto_rawDesc)),
NumEnums: 0,
NumMessages: 12,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_account_proto_goTypes,
DependencyIndexes: file_account_proto_depIdxs,
MessageInfos: file_account_proto_msgTypes,
}.Build()
File_account_proto = out.File
file_account_proto_goTypes = nil
file_account_proto_depIdxs = nil
}

View File

@@ -1,311 +0,0 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v3.21.12
// source: 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_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"
)
// 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)
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)
}
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) 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
}
// 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)
SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error)
UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error)
GetPinStatus(context.Context, *GetPinStatusRequest) (*GetPinStatusResponse, error)
RemovePin(context.Context, *RemovePinRequest) (*RemovePinResponse, 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) 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) 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_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)
}
// 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: "SetPin",
Handler: _AccountService_SetPin_Handler,
},
{
MethodName: "UnlockPin",
Handler: _AccountService_UnlockPin_Handler,
},
{
MethodName: "GetPinStatus",
Handler: _AccountService_GetPinStatus_Handler,
},
{
MethodName: "RemovePin",
Handler: _AccountService_RemovePin_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "account.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,387 +0,0 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v3.21.12
// source: 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: "auth.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,9 @@
// versions: // versions:
// - protoc-gen-go-grpc v1.6.1 // - protoc-gen-go-grpc v1.6.1
// - protoc v3.21.12 // - protoc v3.21.12
// source: twofa.proto // source: identity.proto
package pb package gen
import ( import (
context "context" context "context"
@@ -19,22 +19,274 @@ import (
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion9
const ( const (
TwoFaService_Verify2Fa_FullMethodName = "/twofa.v1.TwoFaService/Verify2Fa" AuthService_Login_FullMethodName = "/identity.AuthService/Login"
TwoFaService_GetTwoFaStatus_FullMethodName = "/twofa.v1.TwoFaService/GetTwoFaStatus" AuthService_Refresh_FullMethodName = "/identity.AuthService/Refresh"
TwoFaService_StartTotpEnrollment_FullMethodName = "/twofa.v1.TwoFaService/StartTotpEnrollment" AuthService_Logout_FullMethodName = "/identity.AuthService/Logout"
TwoFaService_ConfirmTotpErollment_FullMethodName = "/twofa.v1.TwoFaService/ConfirmTotpErollment" AuthService_UnlockPin_FullMethodName = "/identity.AuthService/UnlockPin"
TwoFaService_CancelTotpEnrollment_FullMethodName = "/twofa.v1.TwoFaService/CancelTotpEnrollment" AuthService_Verify2Fa_FullMethodName = "/identity.AuthService/Verify2Fa"
TwoFaService_DisableTotp_FullMethodName = "/twofa.v1.TwoFaService/DisableTotp" )
TwoFaService_StartTelegramEnrollment_FullMethodName = "/twofa.v1.TwoFaService/StartTelegramEnrollment"
TwoFaService_ConfirmTelegramEnrollment_FullMethodName = "/twofa.v1.TwoFaService/ConfirmTelegramEnrollment" // AuthServiceClient is the client API for AuthService service.
TwoFaService_DisableTelegram_FullMethodName = "/twofa.v1.TwoFaService/DisableTelegram" //
// 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)
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
UnlockPin(ctx context.Context, in *UnlockPinRequest, opts ...grpc.CallOption) (*UnlockPinResponse, error)
Verify2Fa(ctx context.Context, in *Verify2FaRequest, opts ...grpc.CallOption) (*Verify2FaResponse, 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) 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) 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, AuthService_UnlockPin_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) 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, AuthService_Verify2Fa_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)
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error)
Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, 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) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Logout not implemented")
}
func (UnimplementedAuthServiceServer) UnlockPin(context.Context, *UnlockPinRequest) (*UnlockPinResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UnlockPin not implemented")
}
func (UnimplementedAuthServiceServer) Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Verify2Fa 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_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_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.(AuthServiceServer).UnlockPin(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_UnlockPin_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).UnlockPin(ctx, req.(*UnlockPinRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_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.(AuthServiceServer).Verify2Fa(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_Verify2Fa_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).Verify2Fa(ctx, req.(*Verify2FaRequest))
}
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: "identity.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Login",
Handler: _AuthService_Login_Handler,
},
{
MethodName: "Refresh",
Handler: _AuthService_Refresh_Handler,
},
{
MethodName: "Logout",
Handler: _AuthService_Logout_Handler,
},
{
MethodName: "UnlockPin",
Handler: _AuthService_UnlockPin_Handler,
},
{
MethodName: "Verify2Fa",
Handler: _AuthService_Verify2Fa_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "identity.proto",
}
const (
TwoFaService_GetTwoFaStatus_FullMethodName = "/identity.TwoFaService/GetTwoFaStatus"
TwoFaService_StartTotpEnrollment_FullMethodName = "/identity.TwoFaService/StartTotpEnrollment"
TwoFaService_ConfirmTotpErollment_FullMethodName = "/identity.TwoFaService/ConfirmTotpErollment"
TwoFaService_CancelTotpEnrollment_FullMethodName = "/identity.TwoFaService/CancelTotpEnrollment"
TwoFaService_DisableTotp_FullMethodName = "/identity.TwoFaService/DisableTotp"
TwoFaService_StartTelegramEnrollment_FullMethodName = "/identity.TwoFaService/StartTelegramEnrollment"
TwoFaService_ConfirmTelegramEnrollment_FullMethodName = "/identity.TwoFaService/ConfirmTelegramEnrollment"
TwoFaService_DisableTelegram_FullMethodName = "/identity.TwoFaService/DisableTelegram"
) )
// TwoFaServiceClient is the client API for TwoFaService service. // 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. // 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 { 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) GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error)
StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error) StartTotpEnrollment(ctx context.Context, in *AuthenticatedAccessRequest, opts ...grpc.CallOption) (*StartTotpEnrollmentResponse, error)
ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error) ConfirmTotpErollment(ctx context.Context, in *ConfirmTotpEnrollmentRequest, opts ...grpc.CallOption) (*ConfirmTotpEnrollmentResponse, error)
@@ -53,16 +305,6 @@ func NewTwoFaServiceClient(cc grpc.ClientConnInterface) TwoFaServiceClient {
return &twoFaServiceClient{cc} 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) { func (c *twoFaServiceClient) GetTwoFaStatus(ctx context.Context, in *GetTwoFaStatusRequest, opts ...grpc.CallOption) (*GetTwoFaStatusResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetTwoFaStatusResponse) out := new(GetTwoFaStatusResponse)
@@ -147,7 +389,6 @@ func (c *twoFaServiceClient) DisableTelegram(ctx context.Context, in *DisableTel
// All implementations must embed UnimplementedTwoFaServiceServer // All implementations must embed UnimplementedTwoFaServiceServer
// for forward compatibility. // for forward compatibility.
type TwoFaServiceServer interface { type TwoFaServiceServer interface {
Verify2Fa(context.Context, *Verify2FaRequest) (*Verify2FaResponse, error)
GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error)
StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error) StartTotpEnrollment(context.Context, *AuthenticatedAccessRequest) (*StartTotpEnrollmentResponse, error)
ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error) ConfirmTotpErollment(context.Context, *ConfirmTotpEnrollmentRequest) (*ConfirmTotpEnrollmentResponse, error)
@@ -166,9 +407,6 @@ type TwoFaServiceServer interface {
// pointer dereference when methods are called. // pointer dereference when methods are called.
type UnimplementedTwoFaServiceServer struct{} 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) { func (UnimplementedTwoFaServiceServer) GetTwoFaStatus(context.Context, *GetTwoFaStatusRequest) (*GetTwoFaStatusResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetTwoFaStatus not implemented") return nil, status.Error(codes.Unimplemented, "method GetTwoFaStatus not implemented")
} }
@@ -214,24 +452,6 @@ func RegisterTwoFaServiceServer(s grpc.ServiceRegistrar, srv TwoFaServiceServer)
s.RegisterService(&TwoFaService_ServiceDesc, srv) 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) { func _TwoFaService_GetTwoFaStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTwoFaStatusRequest) in := new(GetTwoFaStatusRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -380,13 +600,9 @@ func _TwoFaService_DisableTelegram_Handler(srv interface{}, ctx context.Context,
// 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 TwoFaService_ServiceDesc = grpc.ServiceDesc{ var TwoFaService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "twofa.v1.TwoFaService", ServiceName: "identity.TwoFaService",
HandlerType: (*TwoFaServiceServer)(nil), HandlerType: (*TwoFaServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "Verify2Fa",
Handler: _TwoFaService_Verify2Fa_Handler,
},
{ {
MethodName: "GetTwoFaStatus", MethodName: "GetTwoFaStatus",
Handler: _TwoFaService_GetTwoFaStatus_Handler, Handler: _TwoFaService_GetTwoFaStatus_Handler,
@@ -421,5 +637,5 @@ var TwoFaService_ServiceDesc = grpc.ServiceDesc{
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "twofa.proto", Metadata: "identity.proto",
} }

View File

@@ -1,206 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v3.21.12
// source: 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_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_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_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_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_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_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_ldap_auth_proto protoreflect.FileDescriptor
const file_ldap_auth_proto_rawDesc = "" +
"\n" +
"\x0fldap-auth.proto\x12\fldap_auth.v1\x1a\n" +
"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_ldap_auth_proto_rawDescOnce sync.Once
file_ldap_auth_proto_rawDescData []byte
)
func file_ldap_auth_proto_rawDescGZIP() []byte {
file_ldap_auth_proto_rawDescOnce.Do(func() {
file_ldap_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ldap_auth_proto_rawDesc), len(file_ldap_auth_proto_rawDesc)))
})
return file_ldap_auth_proto_rawDescData
}
var file_ldap_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_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_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_ldap_auth_proto_init() }
func file_ldap_auth_proto_init() {
if File_ldap_auth_proto != nil {
return
}
file_ldap_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ldap_auth_proto_rawDesc), len(file_ldap_auth_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_ldap_auth_proto_goTypes,
DependencyIndexes: file_ldap_auth_proto_depIdxs,
MessageInfos: file_ldap_auth_proto_msgTypes,
}.Build()
File_ldap_auth_proto = out.File
file_ldap_auth_proto_goTypes = nil
file_ldap_auth_proto_depIdxs = nil
}

View File

@@ -1,121 +0,0 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc v3.21.12
// source: 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: "ldap-auth.proto",
}

View File

@@ -4,7 +4,7 @@
// protoc v3.21.12 // protoc v3.21.12
// source: ldap.proto // source: ldap.proto
package pb package ldap_service
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -21,29 +21,28 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// ========================================== type VerifyRequest struct {
// БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ
// ==========================================
type EmptyRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` 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 unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *EmptyRequest) Reset() { func (x *VerifyRequest) Reset() {
*x = EmptyRequest{} *x = VerifyRequest{}
mi := &file_ldap_proto_msgTypes[0] mi := &file_ldap_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *EmptyRequest) String() string { func (x *VerifyRequest) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*EmptyRequest) ProtoMessage() {} func (*VerifyRequest) ProtoMessage() {}
func (x *EmptyRequest) ProtoReflect() protoreflect.Message { func (x *VerifyRequest) ProtoReflect() protoreflect.Message {
mi := &file_ldap_proto_msgTypes[0] mi := &file_ldap_proto_msgTypes[0]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -55,34 +54,48 @@ func (x *EmptyRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead. // Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead.
func (*EmptyRequest) Descriptor() ([]byte, []int) { func (*VerifyRequest) Descriptor() ([]byte, []int) {
return file_ldap_proto_rawDescGZIP(), []int{0} return file_ldap_proto_rawDescGZIP(), []int{0}
} }
// Стандартный ответ для мутаций (создание, обновление, удаление) func (x *VerifyRequest) GetUsername() string {
type StatusResponse struct { 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"` state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` 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"` 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 unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *StatusResponse) Reset() { func (x *VerifyResponse) Reset() {
*x = StatusResponse{} *x = VerifyResponse{}
mi := &file_ldap_proto_msgTypes[1] mi := &file_ldap_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
func (x *StatusResponse) String() string { func (x *VerifyResponse) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*StatusResponse) ProtoMessage() {} func (*VerifyResponse) ProtoMessage() {}
func (x *StatusResponse) ProtoReflect() protoreflect.Message { func (x *VerifyResponse) ProtoReflect() protoreflect.Message {
mi := &file_ldap_proto_msgTypes[1] mi := &file_ldap_proto_msgTypes[1]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -94,37 +107,38 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. // Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) Descriptor() ([]byte, []int) { func (*VerifyResponse) Descriptor() ([]byte, []int) {
return file_ldap_proto_rawDescGZIP(), []int{1} return file_ldap_proto_rawDescGZIP(), []int{1}
} }
func (x *StatusResponse) GetSuccess() bool { func (x *VerifyResponse) GetSuccess() bool {
if x != nil { if x != nil {
return x.Success return x.Success
} }
return false return false
} }
func (x *StatusResponse) GetErrorMessage() string { func (x *VerifyResponse) GetErrorMessage() string {
if x != nil { if x != nil {
return x.ErrorMessage return x.ErrorMessage
} }
return "" return ""
} }
// Полная модель пользователя func (x *VerifyResponse) GetUser() *UserData {
if x != nil {
return x.User
}
return nil
}
type UserData struct { type UserData struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` // Полный путь в AD (Distinguished Name) Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // Логин (sAMAccountName) DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // ФИО (displayName) Groups []string `protobuf:"bytes,3,rep,name=groups,proto3" json:"groups,omitempty"`
Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Почта (mail) IsActive bool `protobuf:"varint,4,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
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 unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@@ -166,13 +180,6 @@ func (x *UserData) GetDn() string {
return "" return ""
} }
func (x *UserData) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *UserData) GetDisplayName() string { func (x *UserData) GetDisplayName() string {
if x != nil { if x != nil {
return x.DisplayName return x.DisplayName
@@ -180,27 +187,6 @@ func (x *UserData) GetDisplayName() string {
return "" 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 { func (x *UserData) GetGroups() []string {
if x != nil { if x != nil {
return x.Groups return x.Groups
@@ -215,558 +201,27 @@ func (x *UserData) GetIsActive() bool {
return false 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_ldap_proto protoreflect.FileDescriptor var File_ldap_proto protoreflect.FileDescriptor
const file_ldap_proto_rawDesc = "" + const file_ldap_proto_rawDesc = "" +
"\n" + "\n" +
"\n" + "\n" +
"ldap.proto\x12\aldap.v1\"\x0e\n" + "ldap.proto\x12\fldap_service\"G\n" +
"\fEmptyRequest\"O\n" + "\rVerifyRequest\x12\x1a\n" +
"\x0eStatusResponse\x12\x18\n" + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" + "\bpassword\x18\x02 \x01(\tR\bpassword\"{\n" +
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xf4\x01\n" + "\x0eVerifyResponse\x12\x18\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" + "\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" +
"\x06groups\x18\x03 \x03(\v2\x12.ldap.v1.GroupDataR\x06groups\"\x8d\x01\n" + "\x04user\x18\x03 \x01(\v2\x16.ldap_service.UserDataR\x04user\"r\n" +
"\x11CreateUserRequest\x12\x1a\n" + "\bUserData\x12\x0e\n" +
"\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" + "\x02dn\x18\x01 \x01(\tR\x02dn\x12!\n" +
"\tfull_name\x18\x02 \x01(\tR\bfullName\x12\x1a\n" + "\fdisplay_name\x18\x02 \x01(\tR\vdisplayName\x12\x16\n" +
"\bpassword\x18\x03 \x01(\tR\bpassword\x12\x19\n" + "\x06groups\x18\x03 \x03(\tR\x06groups\x12\x1b\n" +
"\x05email\x18\x04 \x01(\tH\x00R\x05email\x88\x01\x01B\b\n" + "\tis_active\x18\x04 \x01(\bR\bisActive2S\n" +
"\x06_email\"\xec\x01\n" + "\bLdapAuth\x12G\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" + "\n" +
"set_active\x18\x02 \x01(\bR\tsetActive\"K\n" + "VerifyUser\x12\x1b.ldap_service.VerifyRequest\x1a\x1c.ldap_service.VerifyResponseB+Z)git.lendry.ru/lendry-erp/gen;ldap_serviceb\x06proto3"
"\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 ( var (
file_ldap_proto_rawDescOnce sync.Once file_ldap_proto_rawDescOnce sync.Once
@@ -780,44 +235,21 @@ func file_ldap_proto_rawDescGZIP() []byte {
return file_ldap_proto_rawDescData return file_ldap_proto_rawDescData
} }
var file_ldap_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_ldap_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_ldap_proto_goTypes = []any{ var file_ldap_proto_goTypes = []any{
(*EmptyRequest)(nil), // 0: ldap.v1.EmptyRequest (*VerifyRequest)(nil), // 0: ldap_service.VerifyRequest
(*StatusResponse)(nil), // 1: ldap.v1.StatusResponse (*VerifyResponse)(nil), // 1: ldap_service.VerifyResponse
(*UserData)(nil), // 2: ldap.v1.UserData (*UserData)(nil), // 2: ldap_service.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_ldap_proto_depIdxs = []int32{ var file_ldap_proto_depIdxs = []int32{
2, // 0: ldap.v1.UserListResponse.users:type_name -> ldap.v1.UserData 2, // 0: ldap_service.VerifyResponse.user:type_name -> ldap_service.UserData
3, // 1: ldap.v1.GroupListResponse.groups:type_name -> ldap.v1.GroupData 0, // 1: ldap_service.LdapAuth.VerifyUser:input_type -> ldap_service.VerifyRequest
0, // 2: ldap.v1.LdapService.GetUsers:input_type -> ldap.v1.EmptyRequest 1, // 2: ldap_service.LdapAuth.VerifyUser:output_type -> ldap_service.VerifyResponse
6, // 3: ldap.v1.LdapService.CreateUser:input_type -> ldap.v1.CreateUserRequest 2, // [2:3] is the sub-list for method output_type
7, // 4: ldap.v1.LdapService.UpdateUser:input_type -> ldap.v1.UpdateUserRequest 1, // [1:2] is the sub-list for method input_type
8, // 5: ldap.v1.LdapService.ChangePassword:input_type -> ldap.v1.ChangePasswordRequest 1, // [1:1] is the sub-list for extension type_name
9, // 6: ldap.v1.LdapService.ToggleUserStatus:input_type -> ldap.v1.ToggleStatusRequest 1, // [1:1] is the sub-list for extension extendee
0, // 7: ldap.v1.LdapService.GetGroups:input_type -> ldap.v1.EmptyRequest 0, // [0:1] is the sub-list for field type_name
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_ldap_proto_init() } func init() { file_ldap_proto_init() }
@@ -825,15 +257,13 @@ func file_ldap_proto_init() {
if File_ldap_proto != nil { if File_ldap_proto != nil {
return return
} }
file_ldap_proto_msgTypes[6].OneofWrappers = []any{}
file_ldap_proto_msgTypes[7].OneofWrappers = []any{}
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_proto_rawDesc), len(file_ldap_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_ldap_proto_rawDesc), len(file_ldap_proto_rawDesc)),
NumEnums: 0, NumEnums: 0,
NumMessages: 11, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

View File

@@ -4,7 +4,7 @@
// - protoc v3.21.12 // - protoc v3.21.12
// source: ldap.proto // source: ldap.proto
package pb package ldap_service
import ( import (
context "context" context "context"
@@ -19,371 +19,101 @@ import (
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion9
const ( const (
LdapService_GetUsers_FullMethodName = "/ldap.v1.LdapService/GetUsers" LdapAuth_VerifyUser_FullMethodName = "/ldap_service.LdapAuth/VerifyUser"
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. // LdapAuthClient is the client API for LdapAuth 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. // 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 { type LdapAuthClient interface {
// Управление Пользователями (Bind системного аккаунта) --- VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error)
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 { type ldapAuthClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
} }
func NewLdapServiceClient(cc grpc.ClientConnInterface) LdapServiceClient { func NewLdapAuthClient(cc grpc.ClientConnInterface) LdapAuthClient {
return &ldapServiceClient{cc} return &ldapAuthClient{cc}
} }
func (c *ldapServiceClient) GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) { func (c *ldapAuthClient) VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UserListResponse) out := new(VerifyResponse)
err := c.cc.Invoke(ctx, LdapService_GetUsers_FullMethodName, in, out, cOpts...) err := c.cc.Invoke(ctx, LdapAuth_VerifyUser_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *ldapServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) { // LdapAuthServer is the server API for LdapAuth service.
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) // All implementations must embed UnimplementedLdapAuthServer
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. // for forward compatibility.
type LdapServiceServer interface { type LdapAuthServer interface {
// Управление Пользователями (Bind системного аккаунта) --- VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error)
GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) mustEmbedUnimplementedLdapAuthServer()
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 // UnimplementedLdapAuthServer must be embedded to have
// forward compatible implementations. // forward compatible implementations.
// //
// NOTE: this should be embedded by value instead of pointer to avoid a nil // NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called. // pointer dereference when methods are called.
type UnimplementedLdapServiceServer struct{} type UnimplementedLdapAuthServer struct{}
func (UnimplementedLdapServiceServer) GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) { func (UnimplementedLdapAuthServer) VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented") return nil, status.Error(codes.Unimplemented, "method VerifyUser not implemented")
} }
func (UnimplementedLdapServiceServer) CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) { func (UnimplementedLdapAuthServer) mustEmbedUnimplementedLdapAuthServer() {}
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") func (UnimplementedLdapAuthServer) testEmbeddedByValue() {}
}
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. // UnsafeLdapAuthServer 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 // Use of this interface is not recommended, as added methods to LdapAuthServer will
// result in compilation errors. // result in compilation errors.
type UnsafeLdapServiceServer interface { type UnsafeLdapAuthServer interface {
mustEmbedUnimplementedLdapServiceServer() mustEmbedUnimplementedLdapAuthServer()
} }
func RegisterLdapServiceServer(s grpc.ServiceRegistrar, srv LdapServiceServer) { func RegisterLdapAuthServer(s grpc.ServiceRegistrar, srv LdapAuthServer) {
// If the following call panics, it indicates UnimplementedLdapServiceServer was // If the following call panics, it indicates UnimplementedLdapAuthServer was
// embedded by pointer and is nil. This will cause panics if an // embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization // unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O. // time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue() t.testEmbeddedByValue()
} }
s.RegisterService(&LdapService_ServiceDesc, srv) s.RegisterService(&LdapAuth_ServiceDesc, srv)
} }
func _LdapService_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _LdapAuth_VerifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyRequest) in := new(VerifyRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(LdapServiceServer).GetUsers(ctx, in) return srv.(LdapAuthServer).VerifyUser(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: LdapService_GetUsers_FullMethodName, FullMethod: LdapAuth_VerifyUser_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LdapServiceServer).GetUsers(ctx, req.(*EmptyRequest)) return srv.(LdapAuthServer).VerifyUser(ctx, req.(*VerifyRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _LdapService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { // LdapAuth_ServiceDesc is the grpc.ServiceDesc for LdapAuth service.
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, // 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 LdapService_ServiceDesc = grpc.ServiceDesc{ var LdapAuth_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ldap.v1.LdapService", ServiceName: "ldap_service.LdapAuth",
HandlerType: (*LdapServiceServer)(nil), HandlerType: (*LdapAuthServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "GetUsers", MethodName: "VerifyUser",
Handler: _LdapService_GetUsers_Handler, Handler: _LdapAuth_VerifyUser_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{}, Streams: []grpc.StreamDesc{},

View File

@@ -2,14 +2,56 @@
// versions: // versions:
// protoc-gen-ts_proto v2.11.6 // protoc-gen-ts_proto v2.11.6
// protoc v3.21.12 // protoc v3.21.12
// source: twofa.proto // source: identity.proto
/* eslint-disable */ /* eslint-disable */
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 = "twofa.v1"; export const protobufPackage = "identity";
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 {
accessToken: string;
}
export interface LogoutResponse {
success: boolean;
message: string;
}
export interface UnlockPinRequest {
accessToken: string;
pinCode: string;
}
export interface UnlockPinResponse {
success: boolean;
message: string;
}
export interface Verify2FaRequest { export interface Verify2FaRequest {
tempToken: string; tempToken: string;
@@ -19,6 +61,7 @@ export interface Verify2FaRequest {
export interface Verify2FaResponse { export interface Verify2FaResponse {
accessToken: string; accessToken: string;
refreshToken: string;
status: string; status: string;
message: string; message: string;
reserveCodes: string[]; reserveCodes: string[];
@@ -103,77 +146,90 @@ export interface DisableTelegramResponse {
message: string; message: string;
} }
export const TWOFA_V1_PACKAGE_NAME = "twofa.v1"; export const IDENTITY_PACKAGE_NAME = "identity";
export interface AuthServiceClient {
login(request: LoginRequest): Observable<LoginResponse>;
refresh(request: RefreshRequest): Observable<RefreshResponse>;
logout(request: LogoutRequest): Observable<LogoutResponse>;
unlockPin(request: UnlockPinRequest): Observable<UnlockPinResponse>;
verify2Fa(request: Verify2FaRequest): Observable<Verify2FaResponse>;
}
export interface AuthServiceController {
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
unlockPin(request: UnlockPinRequest): Promise<UnlockPinResponse> | Observable<UnlockPinResponse> | UnlockPinResponse;
verify2Fa(request: Verify2FaRequest): Promise<Verify2FaResponse> | Observable<Verify2FaResponse> | Verify2FaResponse;
}
export function AuthServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ["login", "refresh", "logout", "unlockPin", "verify2Fa"];
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";
export interface TwoFaServiceClient { export interface TwoFaServiceClient {
verify2Fa(request: Verify2FaRequest, metadata?: Metadata): Observable<Verify2FaResponse>; getTwoFaStatus(request: GetTwoFaStatusRequest): Observable<GetTwoFaStatusResponse>;
getTwoFaStatus(request: GetTwoFaStatusRequest, metadata?: Metadata): Observable<GetTwoFaStatusResponse>; startTotpEnrollment(request: AuthenticatedAccessRequest): Observable<StartTotpEnrollmentResponse>;
startTotpEnrollment( confirmTotpErollment(request: ConfirmTotpEnrollmentRequest): Observable<ConfirmTotpEnrollmentResponse>;
request: AuthenticatedAccessRequest,
metadata?: Metadata,
): Observable<StartTotpEnrollmentResponse>;
confirmTotpErollment( cancelTotpEnrollment(request: AuthenticatedAccessRequest): Observable<CancelTotpEnrollmentResponse>;
request: ConfirmTotpEnrollmentRequest,
metadata?: Metadata,
): Observable<ConfirmTotpEnrollmentResponse>;
cancelTotpEnrollment( disableTotp(request: DisableTotpRequest): Observable<DisableTotpResponse>;
request: AuthenticatedAccessRequest,
metadata?: Metadata,
): Observable<CancelTotpEnrollmentResponse>;
disableTotp(request: DisableTotpRequest, metadata?: Metadata): Observable<DisableTotpResponse>; startTelegramEnrollment(request: AuthenticatedAccessRequest): Observable<StartTelegramEnrollmentResponse>;
startTelegramEnrollment( confirmTelegramEnrollment(request: ConfirmTelegramEnrollmentRequest): Observable<ConfirmTelegramEnrollmentResponse>;
request: AuthenticatedAccessRequest,
metadata?: Metadata,
): Observable<StartTelegramEnrollmentResponse>;
confirmTelegramEnrollment( disableTelegram(request: DisableTelegramRequest): Observable<DisableTelegramResponse>;
request: ConfirmTelegramEnrollmentRequest,
metadata?: Metadata,
): Observable<ConfirmTelegramEnrollmentResponse>;
disableTelegram(request: DisableTelegramRequest, metadata?: Metadata): Observable<DisableTelegramResponse>;
} }
export interface TwoFaServiceController { export interface TwoFaServiceController {
verify2Fa(
request: Verify2FaRequest,
metadata?: Metadata,
): Promise<Verify2FaResponse> | Observable<Verify2FaResponse> | Verify2FaResponse;
getTwoFaStatus( getTwoFaStatus(
request: GetTwoFaStatusRequest, request: GetTwoFaStatusRequest,
metadata?: Metadata,
): Promise<GetTwoFaStatusResponse> | Observable<GetTwoFaStatusResponse> | GetTwoFaStatusResponse; ): Promise<GetTwoFaStatusResponse> | Observable<GetTwoFaStatusResponse> | GetTwoFaStatusResponse;
startTotpEnrollment( startTotpEnrollment(
request: AuthenticatedAccessRequest, request: AuthenticatedAccessRequest,
metadata?: Metadata,
): Promise<StartTotpEnrollmentResponse> | Observable<StartTotpEnrollmentResponse> | StartTotpEnrollmentResponse; ): Promise<StartTotpEnrollmentResponse> | Observable<StartTotpEnrollmentResponse> | StartTotpEnrollmentResponse;
confirmTotpErollment( confirmTotpErollment(
request: ConfirmTotpEnrollmentRequest, request: ConfirmTotpEnrollmentRequest,
metadata?: Metadata,
): Promise<ConfirmTotpEnrollmentResponse> | Observable<ConfirmTotpEnrollmentResponse> | ConfirmTotpEnrollmentResponse; ): Promise<ConfirmTotpEnrollmentResponse> | Observable<ConfirmTotpEnrollmentResponse> | ConfirmTotpEnrollmentResponse;
cancelTotpEnrollment( cancelTotpEnrollment(
request: AuthenticatedAccessRequest, request: AuthenticatedAccessRequest,
metadata?: Metadata,
): Promise<CancelTotpEnrollmentResponse> | Observable<CancelTotpEnrollmentResponse> | CancelTotpEnrollmentResponse; ): Promise<CancelTotpEnrollmentResponse> | Observable<CancelTotpEnrollmentResponse> | CancelTotpEnrollmentResponse;
disableTotp( disableTotp(
request: DisableTotpRequest, request: DisableTotpRequest,
metadata?: Metadata,
): Promise<DisableTotpResponse> | Observable<DisableTotpResponse> | DisableTotpResponse; ): Promise<DisableTotpResponse> | Observable<DisableTotpResponse> | DisableTotpResponse;
startTelegramEnrollment( startTelegramEnrollment(
request: AuthenticatedAccessRequest, request: AuthenticatedAccessRequest,
metadata?: Metadata,
): ):
| Promise<StartTelegramEnrollmentResponse> | Promise<StartTelegramEnrollmentResponse>
| Observable<StartTelegramEnrollmentResponse> | Observable<StartTelegramEnrollmentResponse>
@@ -181,7 +237,6 @@ export interface TwoFaServiceController {
confirmTelegramEnrollment( confirmTelegramEnrollment(
request: ConfirmTelegramEnrollmentRequest, request: ConfirmTelegramEnrollmentRequest,
metadata?: Metadata,
): ):
| Promise<ConfirmTelegramEnrollmentResponse> | Promise<ConfirmTelegramEnrollmentResponse>
| Observable<ConfirmTelegramEnrollmentResponse> | Observable<ConfirmTelegramEnrollmentResponse>
@@ -189,14 +244,12 @@ export interface TwoFaServiceController {
disableTelegram( disableTelegram(
request: DisableTelegramRequest, request: DisableTelegramRequest,
metadata?: Metadata,
): Promise<DisableTelegramResponse> | Observable<DisableTelegramResponse> | DisableTelegramResponse; ): Promise<DisableTelegramResponse> | Observable<DisableTelegramResponse> | DisableTelegramResponse;
} }
export function TwoFaServiceControllerMethods() { export function TwoFaServiceControllerMethods() {
return function (constructor: Function) { return function (constructor: Function) {
const grpcMethods: string[] = [ const grpcMethods: string[] = [
"verify2Fa",
"getTwoFaStatus", "getTwoFaStatus",
"startTotpEnrollment", "startTotpEnrollment",
"confirmTotpErollment", "confirmTotpErollment",

View File

@@ -1,56 +0,0 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v3.21.12
// source: 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<VerifyResponse>;
}
export interface LdapAuthServiceController {
verifyUser(
request: VerifyRequest,
metadata?: Metadata,
): Promise<VerifyResponse> | Observable<VerifyResponse> | 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";

View File

@@ -5,207 +5,52 @@
// source: ldap.proto // source: ldap.proto
/* eslint-disable */ /* eslint-disable */
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 = "ldap.v1"; export const protobufPackage = "ldap_service";
/** export interface VerifyRequest {
* ==========================================
* БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ
* ==========================================
*/
export interface EmptyRequest {
}
/** Стандартный ответ для мутаций (создание, обновление, удаление) */
export interface StatusResponse {
success: boolean;
errorMessage: string;
}
/** Полная модель пользователя */
export interface UserData {
/** Полный путь в AD (Distinguished Name) */
dn: string;
/** Логин (sAMAccountName) */
username: string; 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; password: string;
/** Сразу при создании можно задать почту */
email?: string | undefined;
} }
/** Запрос на обновление. Используем optional для частичного обновления. */ export interface VerifyResponse {
export interface UpdateUserRequest { success: boolean;
/** Обязательное поле: кого обновляем */ errorMessage: string;
username: string; user: UserData | undefined;
/** Новое ФИО (повлечет Rename CN) */
displayName?:
| string
| undefined;
/** Новая почта */
email?:
| string
| undefined;
/** Новое описание */
description?:
| string
| undefined;
/** Новая аватарка (бинарник картинки) */
avatar?: Uint8Array | undefined;
} }
export interface ChangePasswordRequest { export interface UserData {
username: string; dn: string;
newPassword: string; displayName: string;
groups: string[];
isActive: boolean;
} }
export interface ToggleStatusRequest { export const LDAP_SERVICE_PACKAGE_NAME = "ldap_service";
username: string;
/** true - включить (512), false - отключить (514) */ export interface LdapAuthClient {
setActive: boolean; verifyUser(request: VerifyRequest): Observable<VerifyResponse>;
} }
/** --- Управление членством в группах --- */ export interface LdapAuthController {
export interface GroupMemberRequest { verifyUser(request: VerifyRequest): Promise<VerifyResponse> | Observable<VerifyResponse> | VerifyResponse;
/** Логин пользователя */
username: string;
/** Полный путь группы (в которую добавляем / из которой удаляем) */
groupDn: string;
} }
export const LDAP_V1_PACKAGE_NAME = "ldap.v1"; export function LdapAuthControllerMethods() {
export interface LdapServiceClient {
/** Управление Пользователями (Bind системного аккаунта) --- */
getUsers(request: EmptyRequest, metadata?: Metadata): Observable<UserListResponse>;
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<StatusResponse>;
updateUser(request: UpdateUserRequest, metadata?: Metadata): Observable<StatusResponse>;
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<StatusResponse>;
toggleUserStatus(request: ToggleStatusRequest, metadata?: Metadata): Observable<StatusResponse>;
/** Управление Группами --- */
getGroups(request: EmptyRequest, metadata?: Metadata): Observable<GroupListResponse>;
addUserToGroup(request: GroupMemberRequest, metadata?: Metadata): Observable<StatusResponse>;
removeUserFromGroup(request: GroupMemberRequest, metadata?: Metadata): Observable<StatusResponse>;
}
export interface LdapServiceController {
/** Управление Пользователями (Bind системного аккаунта) --- */
getUsers(
request: EmptyRequest,
metadata?: Metadata,
): Promise<UserListResponse> | Observable<UserListResponse> | UserListResponse;
createUser(
request: CreateUserRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
updateUser(
request: UpdateUserRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
changePassword(
request: ChangePasswordRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
toggleUserStatus(
request: ToggleStatusRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
/** Управление Группами --- */
getGroups(
request: EmptyRequest,
metadata?: Metadata,
): Promise<GroupListResponse> | Observable<GroupListResponse> | GroupListResponse;
addUserToGroup(
request: GroupMemberRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
removeUserFromGroup(
request: GroupMemberRequest,
metadata?: Metadata,
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
}
export function LdapServiceControllerMethods() {
return function (constructor: Function) { return function (constructor: Function) {
const grpcMethods: string[] = [ const grpcMethods: string[] = ["verifyUser"];
"getUsers",
"createUser",
"updateUser",
"changePassword",
"toggleUserStatus",
"getGroups",
"addUserToGroup",
"removeUserFromGroup",
];
for (const method of grpcMethods) { for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("LdapService", method)(constructor.prototype[method], method, descriptor); GrpcMethod("LdapAuth", method)(constructor.prototype[method], method, descriptor);
} }
const grpcStreamMethods: string[] = []; const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) { for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod("LdapService", method)(constructor.prototype[method], method, descriptor); GrpcStreamMethod("LdapAuth", method)(constructor.prototype[method], method, descriptor);
} }
}; };
} }
export const LDAP_SERVICE_NAME = "LdapService"; export const LDAP_AUTH_SERVICE_NAME = "LdapAuth";

2
go.mod
View File

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

55
package-lock.json generated
View File

@@ -1,15 +1,14 @@
{ {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.24", "version": "1.0.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.24", "version": "1.0.2",
"dependencies": { "dependencies": {
"@lendry-erp/contracts": "^1.0.24", "@lendry-erp/contracts": "^1.0.2",
"@lendry-erp/passport": "^1.0.3",
"@nestjs/microservices": "^11.1.17", "@nestjs/microservices": "^11.1.17",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"ts-proto": "^2.11.6" "ts-proto": "^2.11.6"
@@ -24,6 +23,7 @@
"resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.2.tgz", "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.2.tgz",
"integrity": "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==", "integrity": "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"funding": { "funding": {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/Borewit" "url": "https://github.com/sponsors/Borewit"
@@ -36,32 +36,21 @@
"license": "(Apache-2.0 AND BSD-3-Clause)" "license": "(Apache-2.0 AND BSD-3-Clause)"
}, },
"node_modules/@lendry-erp/contracts": { "node_modules/@lendry-erp/contracts": {
"version": "1.0.24", "version": "1.0.2",
"resolved": "https://git.lendry.ru/api/packages/lendry-erp/npm/%40lendry-erp%2Fcontracts/-/1.0.24/contracts-1.0.24.tgz", "resolved": "https://git.lendry.ru/api/packages/lendry-erp/npm/%40lendry-erp%2Fcontracts/-/1.0.2/contracts-1.0.2.tgz",
"integrity": "sha512-Bn4RgU22O6IDFhYEbQicBLpRtSGHrEgqOSAljQh4lT5shMeLedlE0V3jFxzFu9xpyTzcM/o+C96vpsAHab0tbg==", "integrity": "sha512-39NulQ6mn3dmrX/GXwzYYPyX/rE+4gO1En+uJJR9bHXZ3awWi0U3drIvgwM25gyi829Ae0U8vVtzMaP3gON90A==",
"dependencies": { "dependencies": {
"@nestjs/microservices": "^11.1.17", "@nestjs/microservices": "^11.1.17",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"ts-proto": "^2.11.6" "ts-proto": "^2.11.6"
} }
}, },
"node_modules/@lendry-erp/passport": {
"version": "1.0.3",
"resolved": "https://git.lendry.ru/api/packages/lendry-erp/npm/%40lendry-erp%2Fpassport/-/1.0.3/passport-1.0.3.tgz",
"integrity": "sha512-gaPdlZahkXmOUnLBlzNdk41nJ1BI6TPZY5xUaCmlIkpqZKr8D5TSBBkFrw4Vlw+TLImqL2Y1JUT4k60gHHtjiw==",
"license": "ISC",
"dependencies": {
"@nestjs/common": "^11.1.17",
"@nestjs/core": "^11.1.17",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2"
}
},
"node_modules/@lukeed/csprng": { "node_modules/@lukeed/csprng": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz",
"integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=8" "node": ">=8"
} }
@@ -71,6 +60,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.17.tgz", "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.17.tgz",
"integrity": "sha512-hLODw5Abp8OQgA+mUO4tHou4krKgDtUcM9j5Ihxncst9XeyxYBTt2bwZm4e4EQr5E352S4Fyy6V3iFx9ggxKAg==", "integrity": "sha512-hLODw5Abp8OQgA+mUO4tHou4krKgDtUcM9j5Ihxncst9XeyxYBTt2bwZm4e4EQr5E352S4Fyy6V3iFx9ggxKAg==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"file-type": "21.3.2", "file-type": "21.3.2",
"iterare": "1.2.1", "iterare": "1.2.1",
@@ -103,6 +93,7 @@
"integrity": "sha512-lD5mAYekTTurF3vDaa8C2OKPnjiz4tsfxIc5XlcSUzOhkwWf6Ay3HKvt6FmvuWQam6uIIHX52Clg+e6tAvf/cg==", "integrity": "sha512-lD5mAYekTTurF3vDaa8C2OKPnjiz4tsfxIc5XlcSUzOhkwWf6Ay3HKvt6FmvuWQam6uIIHX52Clg+e6tAvf/cg==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@nuxt/opencollective": "0.4.1", "@nuxt/opencollective": "0.4.1",
"fast-safe-stringify": "2.1.1", "fast-safe-stringify": "2.1.1",
@@ -201,6 +192,7 @@
"resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz",
"integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"consola": "^3.2.3" "consola": "^3.2.3"
}, },
@@ -217,6 +209,7 @@
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz",
"integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==", "integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"debug": "^4.4.3", "debug": "^4.4.3",
"token-types": "^6.1.1" "token-types": "^6.1.1"
@@ -233,7 +226,8 @@
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
"integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==",
"license": "MIT" "license": "MIT",
"peer": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "25.5.0", "version": "25.5.0",
@@ -262,6 +256,7 @@
"resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
"integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": "^14.18.0 || >=16.10.0" "node": "^14.18.0 || >=16.10.0"
} }
@@ -271,6 +266,7 @@
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"ms": "^2.1.3" "ms": "^2.1.3"
}, },
@@ -308,13 +304,15 @@
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
"integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
"license": "MIT" "license": "MIT",
"peer": true
}, },
"node_modules/file-type": { "node_modules/file-type": {
"version": "21.3.2", "version": "21.3.2",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.2.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.2.tgz",
"integrity": "sha512-DLkUvGwep3poOV2wpzbHCOnSKGk1LzyXTv+aHFgN2VFl96wnp8YA9YjO2qPzg5PuL8q/SW9Pdi6WTkYOIh995w==", "integrity": "sha512-DLkUvGwep3poOV2wpzbHCOnSKGk1LzyXTv+aHFgN2VFl96wnp8YA9YjO2qPzg5PuL8q/SW9Pdi6WTkYOIh995w==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@tokenizer/inflate": "^0.4.1", "@tokenizer/inflate": "^0.4.1",
"strtok3": "^10.3.4", "strtok3": "^10.3.4",
@@ -346,7 +344,8 @@
"url": "https://feross.org/support" "url": "https://feross.org/support"
} }
], ],
"license": "BSD-3-Clause" "license": "BSD-3-Clause",
"peer": true
}, },
"node_modules/iterare": { "node_modules/iterare": {
"version": "1.2.1", "version": "1.2.1",
@@ -372,6 +371,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=13.2.0" "node": ">=13.2.0"
} }
@@ -380,13 +380,15 @@
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"license": "MIT" "license": "MIT",
"peer": true
}, },
"node_modules/path-to-regexp": { "node_modules/path-to-regexp": {
"version": "8.3.0", "version": "8.3.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
"license": "MIT", "license": "MIT",
"peer": true,
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/express" "url": "https://opencollective.com/express"
@@ -396,7 +398,8 @@
"version": "0.2.2", "version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",
"license": "Apache-2.0" "license": "Apache-2.0",
"peer": true
}, },
"node_modules/rxjs": { "node_modules/rxjs": {
"version": "7.8.2", "version": "7.8.2",
@@ -412,6 +415,7 @@
"resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz",
"integrity": "sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==", "integrity": "sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@tokenizer/token": "^0.3.0" "@tokenizer/token": "^0.3.0"
}, },
@@ -428,6 +432,7 @@
"resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz", "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz",
"integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==", "integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@borewit/text-codec": "^0.2.1", "@borewit/text-codec": "^0.2.1",
"@tokenizer/token": "^0.3.0", "@tokenizer/token": "^0.3.0",
@@ -499,6 +504,7 @@
"resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz",
"integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@lukeed/csprng": "^1.0.0" "@lukeed/csprng": "^1.0.0"
}, },
@@ -511,6 +517,7 @@
"resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz",
"integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==",
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.48", "version": "1.0.16",
"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",
@@ -17,8 +17,6 @@
"access": "public" "access": "public"
}, },
"dependencies": { "dependencies": {
"@lendry-erp/contracts": "^1.0.24",
"@lendry-erp/passport": "^1.0.3",
"@nestjs/microservices": "^11.1.17", "@nestjs/microservices": "^11.1.17",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"ts-proto": "^2.11.6" "ts-proto": "^2.11.6"

View File

@@ -1,114 +0,0 @@
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 ChangeData(ChangeDataRequest) returns (ChangeDataResponse);
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 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 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;
}

View File

@@ -1,104 +0,0 @@
syntax = "proto3";
package auth.v1;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
service AuthService {
rpc Login (LoginRequest) returns (LoginResponse);
rpc Refresh (RefreshRequest) returns (RefreshResponse);
rpc VerifyToken (VerifyTokenRequest) returns (VerifyTokenResponse);
rpc GetAccountRoleLevel (GetAccountRoleLevelRequest) returns (GetAccountRoleLevelResponse);
rpc Logout (LogoutRequest) returns (LogoutResponse);
rpc LogoutOther (LogoutRequest) returns (LogoutResponse);
rpc GetSessions(GetSessionRequest) returns (GetSessionsResponse);
rpc TerminateSession(TerminateSessionRequest) returns (TerminateSessionResponse);
}
message LoginRequest {
string username = 1;
string password = 2;
}
message LoginResponse {
string access_token = 1;
string refresh_token = 2;
string status = 3;
bool need2fa = 4;
optional string temp_token = 5;
optional string message = 6;
optional string error_code = 7;
}
message RefreshRequest {
string refresh_token = 1;
}
message RefreshResponse {
string access_token = 1;
string refresh_token = 2;
}
message LogoutRequest {
string user_id = 1;
string session_id = 2;
}
message LogoutResponse {
bool success = 1;
string message = 2;
}
message VerifyTokenRequest {
string token = 1;
}
message VerifyTokenResponse {
bool is_valid = 1;
optional string error_message = 2;
optional string id = 3;
optional string username = 4;
optional int32 role_level = 5;
repeated string permissions = 6;
optional string session_id = 7;
optional bool requires_pin = 8;
}
message GetAccountRoleLevelRequest {
string account_id = 1;
}
message GetAccountRoleLevelResponse {
bool found = 1;
int32 role_level = 2;
}
message GetSessionRequest {
string user_id = 1;
string current_session_id = 2;
}
message SessionItem {
string id = 1; // Здесь будет лежать захэшированный ID
string ip_address = 2;
string user_agent = 3;
int64 last_activity = 4; // Unix timestamp в миллисекундах
bool is_current = 5; // Флаг текущей сессии
}
message GetSessionsResponse {
repeated SessionItem sessions = 1;
}
message TerminateSessionRequest {
string user_id = 1;
string target_hash = 2; // Хэш сессии, которую нужно убить
}
message TerminateSessionResponse {
bool success = 1;
string message = 2;
}

View File

@@ -1,21 +1,72 @@
syntax = "proto3"; syntax = "proto3";
package twofa.v1; package identity;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; option go_package = "./gen";
service AuthService {
rpc Login (LoginRequest) returns (LoginResponse);
rpc Refresh (RefreshRequest) returns (RefreshResponse);
rpc Logout (LogoutRequest) returns (LogoutResponse);
rpc UnlockPin (UnlockPinRequest) returns (UnlockPinResponse);
rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse);
}
service TwoFaService { service TwoFaService {
rpc Verify2Fa (Verify2FaRequest) returns (Verify2FaResponse); rpc GetTwoFaStatus (GetTwoFaStatusRequest) returns (GetTwoFaStatusResponse);
rpc GetTwoFaStatus (GetTwoFaStatusRequest) returns (GetTwoFaStatusResponse); rpc StartTotpEnrollment (AuthenticatedAccessRequest) returns (StartTotpEnrollmentResponse);
rpc StartTotpEnrollment (AuthenticatedAccessRequest) returns (StartTotpEnrollmentResponse); rpc ConfirmTotpErollment (ConfirmTotpEnrollmentRequest) returns (ConfirmTotpEnrollmentResponse);
rpc ConfirmTotpErollment (ConfirmTotpEnrollmentRequest) returns (ConfirmTotpEnrollmentResponse); rpc CancelTotpEnrollment (AuthenticatedAccessRequest) returns (CancelTotpEnrollmentResponse);
rpc CancelTotpEnrollment (AuthenticatedAccessRequest) returns (CancelTotpEnrollmentResponse); rpc DisableTotp (DisableTotpRequest) returns (DisableTotpResponse);
rpc DisableTotp (DisableTotpRequest) returns (DisableTotpResponse); rpc StartTelegramEnrollment (AuthenticatedAccessRequest) returns (StartTelegramEnrollmentResponse);
rpc StartTelegramEnrollment (AuthenticatedAccessRequest) returns (StartTelegramEnrollmentResponse); rpc ConfirmTelegramEnrollment (ConfirmTelegramEnrollmentRequest) returns (ConfirmTelegramEnrollmentResponse);
rpc ConfirmTelegramEnrollment (ConfirmTelegramEnrollmentRequest) returns (ConfirmTelegramEnrollmentResponse); rpc DisableTelegram(DisableTelegramRequest) returns (DisableTelegramResponse);
rpc DisableTelegram(DisableTelegramRequest) returns (DisableTelegramResponse);
} }
message LoginRequest {
string username = 1;
string password = 2;
}
message LoginResponse {
string access_token = 1;
string refresh_token = 2;
string status = 3;
bool need2fa = 4;
optional string temp_token = 5;
optional string message = 6;
optional string error_code = 7;
}
message RefreshRequest {
string refresh_token = 1;
}
message RefreshResponse {
string access_token = 1;
string refresh_token = 2;
}
message LogoutRequest {
string access_token = 1;
}
message LogoutResponse {
bool success = 1;
string message = 2;
}
message UnlockPinRequest {
string access_token = 1;
string pin_code = 2;
}
message UnlockPinResponse {
bool success = 1;
string message = 2;
}
message Verify2FaRequest { message Verify2FaRequest {
string temp_token = 1; string temp_token = 1;
optional string totp_code = 2; optional string totp_code = 2;
@@ -24,6 +75,7 @@ message Verify2FaRequest {
message Verify2FaResponse { message Verify2FaResponse {
string access_token = 1; string access_token = 1;
string refresh_token = 2;
string status = 3; string status = 3;
string message = 4; string message = 4;
repeated string reserve_codes = 5; repeated string reserve_codes = 5;
@@ -107,4 +159,3 @@ message DisableTelegramResponse {
string status = 1; string status = 1;
string message = 2; string message = 2;
} }

View File

@@ -1,26 +0,0 @@
syntax = "proto3";
package ldap_auth.v1;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
import "ldap.proto";
service LdapAuthService {
rpc VerifyUser (VerifyRequest) returns (VerifyResponse);
}
// --- Авторизация ---
message VerifyRequest {
string username = 1;
string password = 2;
}
message VerifyResponse {
bool success = 1;
string error_message = 2;
ldap.v1.UserData user = 3; // Отдаем полные данные при успешном входе
}

View File

@@ -1,95 +1,28 @@
syntax = "proto3"; syntax = "proto3";
package ldap.v1; package ldap_service;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb"; option go_package = "git.lendry.ru/lendry-erp/contracts.git/ldap-service/v1;ldap_service";
service LdapService { service LdapAuth {
// Управление Пользователями (Bind системного аккаунта) --- rpc VerifyUser (VerifyRequest) returns (VerifyResponse);
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);
// Управление Группами ---
rpc GetGroups (EmptyRequest) returns (GroupListResponse);
rpc AddUserToGroup (GroupMemberRequest) returns (StatusResponse);
rpc RemoveUserFromGroup (GroupMemberRequest) returns (StatusResponse);
} }
// ========================================== message VerifyRequest {
// БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ string username = 1;
// ========================================== string password = 2;
message EmptyRequest {} }
// Стандартный ответ для мутаций (создание, обновление, удаление) message VerifyResponse {
message StatusResponse {
bool success = 1; bool success = 1;
string error_message = 2; string error_message = 2;
UserData user = 3;
} }
// Полная модель пользователя
message UserData { 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; // Статус аккаунта
string phone = 9;
}
// Модель группы
message GroupData {
string dn = 1; string dn = 1;
string name = 2; // Короткое имя группы (cn) 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; // Полный путь группы (в которую добавляем / из которой удаляем)
}

View File

@@ -1,9 +1,6 @@
import { join } from "path"; import { join } from "path";
export const PROTO_PATHS = { export const PROTO_PATHS = {
AUTH: join(__dirname, "../../proto/auth.proto"), AUTH: join(__dirname, "../../proto/identity.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;