Files
contracts/gen/sso/ldap-auth.ts
2026-05-08 12:36:58 +00:00

76 lines
2.3 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.8
// protoc v4.25.9
// source: sso/ldap-auth.proto
/* eslint-disable */
import type { Metadata } from "@grpc/grpc-js";
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { Observable } from "rxjs";
export const protobufPackage = "ldap_auth.v1";
export interface LdapUserData {
/** Полный путь в AD (Distinguished Name) */
dn: string;
/** Логин (sAMAccountName) */
username: string;
/** ФИО (displayName) */
displayName: string;
/** Почта (mail) */
email: string;
/** Описание/Должность (description) */
description: string;
/** Аватарка в байтах (thumbnailPhoto) */
avatar: Uint8Array;
/** Список групп */
groups: string[];
/** Статус аккаунта */
isActive: boolean;
phone: string;
}
/** --- Авторизация --- */
export interface VerifyRequest {
username: string;
password: string;
}
export interface VerifyResponse {
success: boolean;
errorMessage: string;
/** Отдаем полные данные при успешном входе */
user: LdapUserData | 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";