chore: auto-generate protobuf files [skip ci]
This commit is contained in:
247
gen/admin/admin-account.ts
Normal file
247
gen/admin/admin-account.ts
Normal file
@@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: admin/admin-account.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "admin.account.v1";
|
||||
|
||||
export interface AdminResetPasswordRequest {
|
||||
userId: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface AdminResetPasswordResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CreateUserRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface CreateUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DeleteUserRequest {
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface DeleteUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ChangeDataRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
fullName?: string | undefined;
|
||||
avatarUrl?: string | undefined;
|
||||
customStatusText?: string | undefined;
|
||||
customStatusEmoji?: string | undefined;
|
||||
timezone?: string | undefined;
|
||||
language?: string | undefined;
|
||||
isPublic?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface ChangeDataResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface AssignRoleRequest {
|
||||
userId: string;
|
||||
/** В gRPC передаем как string, внутри преобразуем в Int */
|
||||
roleId: string;
|
||||
}
|
||||
|
||||
export interface AssignRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RevokeRoleRequest {
|
||||
userId: string;
|
||||
roleId: string;
|
||||
}
|
||||
|
||||
export interface RevokeRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface BlockUserRequest {
|
||||
/** Кого блокируем */
|
||||
userId: string;
|
||||
/** Кто блокирует */
|
||||
adminId: string;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BlockUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface UnblockUserRequest {
|
||||
userId: string;
|
||||
adminId: string;
|
||||
}
|
||||
|
||||
export interface UnblockUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface BlockIpRequest {
|
||||
ipAddress: string;
|
||||
adminId: string;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BlockIpResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface UnblockIpRequest {
|
||||
ipAddress: string;
|
||||
adminId: string;
|
||||
}
|
||||
|
||||
export interface UnblockIpResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/** Можно оставить пустым, так как нам не нужны входные данные */
|
||||
export interface SyncUsersToSearchRequest {
|
||||
}
|
||||
|
||||
export interface SyncUsersToSearchResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const ADMIN_ACCOUNT_V1_PACKAGE_NAME = "admin.account.v1";
|
||||
|
||||
export interface AdminAccountServiceClient {
|
||||
adminResetPassword(request: AdminResetPasswordRequest, metadata?: Metadata): Observable<AdminResetPasswordResponse>;
|
||||
|
||||
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>;
|
||||
|
||||
deleteUser(request: DeleteUserRequest, metadata?: Metadata): Observable<DeleteUserResponse>;
|
||||
|
||||
changeData(request: ChangeDataRequest, metadata?: Metadata): Observable<ChangeDataResponse>;
|
||||
|
||||
assignRole(request: AssignRoleRequest, metadata?: Metadata): Observable<AssignRoleResponse>;
|
||||
|
||||
revokeRole(request: RevokeRoleRequest, metadata?: Metadata): Observable<RevokeRoleResponse>;
|
||||
|
||||
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<BlockUserResponse>;
|
||||
|
||||
unblockUser(request: UnblockUserRequest, metadata?: Metadata): Observable<UnblockUserResponse>;
|
||||
|
||||
blockIp(request: BlockIpRequest, metadata?: Metadata): Observable<BlockIpResponse>;
|
||||
|
||||
unblockIp(request: UnblockIpRequest, metadata?: Metadata): Observable<UnblockIpResponse>;
|
||||
|
||||
syncUsersToSearch(request: SyncUsersToSearchRequest, metadata?: Metadata): Observable<SyncUsersToSearchResponse>;
|
||||
}
|
||||
|
||||
export interface AdminAccountServiceController {
|
||||
adminResetPassword(
|
||||
request: AdminResetPasswordRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<AdminResetPasswordResponse> | Observable<AdminResetPasswordResponse> | AdminResetPasswordResponse;
|
||||
|
||||
createUser(
|
||||
request: CreateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
||||
|
||||
deleteUser(
|
||||
request: DeleteUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
|
||||
|
||||
changeData(
|
||||
request: ChangeDataRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ChangeDataResponse> | Observable<ChangeDataResponse> | ChangeDataResponse;
|
||||
|
||||
assignRole(
|
||||
request: AssignRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<AssignRoleResponse> | Observable<AssignRoleResponse> | AssignRoleResponse;
|
||||
|
||||
revokeRole(
|
||||
request: RevokeRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<RevokeRoleResponse> | Observable<RevokeRoleResponse> | RevokeRoleResponse;
|
||||
|
||||
blockUser(
|
||||
request: BlockUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
|
||||
|
||||
unblockUser(
|
||||
request: UnblockUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<UnblockUserResponse> | Observable<UnblockUserResponse> | UnblockUserResponse;
|
||||
|
||||
blockIp(
|
||||
request: BlockIpRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<BlockIpResponse> | Observable<BlockIpResponse> | BlockIpResponse;
|
||||
|
||||
unblockIp(
|
||||
request: UnblockIpRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<UnblockIpResponse> | Observable<UnblockIpResponse> | UnblockIpResponse;
|
||||
|
||||
syncUsersToSearch(
|
||||
request: SyncUsersToSearchRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<SyncUsersToSearchResponse> | Observable<SyncUsersToSearchResponse> | SyncUsersToSearchResponse;
|
||||
}
|
||||
|
||||
export function AdminAccountServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = [
|
||||
"adminResetPassword",
|
||||
"createUser",
|
||||
"deleteUser",
|
||||
"changeData",
|
||||
"assignRole",
|
||||
"revokeRole",
|
||||
"blockUser",
|
||||
"unblockUser",
|
||||
"blockIp",
|
||||
"unblockIp",
|
||||
"syncUsersToSearch",
|
||||
];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("AdminAccountService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("AdminAccountService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const ADMIN_ACCOUNT_SERVICE_NAME = "AdminAccountService";
|
||||
172
gen/admin/rbac.ts
Normal file
172
gen/admin/rbac.ts
Normal file
@@ -0,0 +1,172 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: admin/rbac.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "rbac.v1";
|
||||
|
||||
export interface GetAllPermissionsRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface GetAllPermissionsResponse {
|
||||
permissions: Permission[];
|
||||
}
|
||||
|
||||
export interface Permission {
|
||||
id: string;
|
||||
code: string;
|
||||
description: string;
|
||||
module: string;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface GetAllRolesRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface GetAllRolesResponse {
|
||||
roles: Roles[];
|
||||
}
|
||||
|
||||
export interface CreateRoleRequest {
|
||||
name: string;
|
||||
level: number;
|
||||
permissionCodes: string[];
|
||||
}
|
||||
|
||||
export interface UpdateRoleRequest {
|
||||
id: string;
|
||||
name?: string | undefined;
|
||||
level?: number | undefined;
|
||||
permissionCodes: string[];
|
||||
}
|
||||
|
||||
export interface ModifyRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DeleteRoleRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface DeleteRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
fallbackRoleName?: string | undefined;
|
||||
}
|
||||
|
||||
export interface CreatePermissionRequest {
|
||||
code: string;
|
||||
description: string;
|
||||
module: string;
|
||||
}
|
||||
|
||||
export interface UpdatePermissionRequest {
|
||||
id: string;
|
||||
/** Привязка к конкретным ролям */
|
||||
roleIds: string[];
|
||||
}
|
||||
|
||||
export interface ModifyPermissionResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface Roles {
|
||||
id: string;
|
||||
name: string;
|
||||
level: number;
|
||||
permissions: string[];
|
||||
ldapMapping: string[];
|
||||
accounts: string[];
|
||||
}
|
||||
|
||||
export const RBAC_V1_PACKAGE_NAME = "rbac.v1";
|
||||
|
||||
export interface RbacServiceClient {
|
||||
createRole(request: CreateRoleRequest, metadata?: Metadata): Observable<ModifyRoleResponse>;
|
||||
|
||||
updateRole(request: UpdateRoleRequest, metadata?: Metadata): Observable<ModifyRoleResponse>;
|
||||
|
||||
deleteRole(request: DeleteRoleRequest, metadata?: Metadata): Observable<DeleteRoleResponse>;
|
||||
|
||||
createPermission(request: CreatePermissionRequest, metadata?: Metadata): Observable<ModifyPermissionResponse>;
|
||||
|
||||
updatePermission(request: UpdatePermissionRequest, metadata?: Metadata): Observable<ModifyPermissionResponse>;
|
||||
|
||||
getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>;
|
||||
|
||||
getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>;
|
||||
}
|
||||
|
||||
export interface RbacServiceController {
|
||||
createRole(
|
||||
request: CreateRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ModifyRoleResponse> | Observable<ModifyRoleResponse> | ModifyRoleResponse;
|
||||
|
||||
updateRole(
|
||||
request: UpdateRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ModifyRoleResponse> | Observable<ModifyRoleResponse> | ModifyRoleResponse;
|
||||
|
||||
deleteRole(
|
||||
request: DeleteRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<DeleteRoleResponse> | Observable<DeleteRoleResponse> | DeleteRoleResponse;
|
||||
|
||||
createPermission(
|
||||
request: CreatePermissionRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ModifyPermissionResponse> | Observable<ModifyPermissionResponse> | ModifyPermissionResponse;
|
||||
|
||||
updatePermission(
|
||||
request: UpdatePermissionRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ModifyPermissionResponse> | Observable<ModifyPermissionResponse> | ModifyPermissionResponse;
|
||||
|
||||
getAllPermissions(
|
||||
request: GetAllPermissionsRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<GetAllPermissionsResponse> | Observable<GetAllPermissionsResponse> | GetAllPermissionsResponse;
|
||||
|
||||
getAllRoles(
|
||||
request: GetAllRolesRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<GetAllRolesResponse> | Observable<GetAllRolesResponse> | GetAllRolesResponse;
|
||||
}
|
||||
|
||||
export function RbacServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = [
|
||||
"createRole",
|
||||
"updateRole",
|
||||
"deleteRole",
|
||||
"createPermission",
|
||||
"updatePermission",
|
||||
"getAllPermissions",
|
||||
"getAllRoles",
|
||||
];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const RBAC_SERVICE_NAME = "RbacService";
|
||||
1448
gen/go/admin/admin-account.pb.go
Normal file
1448
gen/go/admin/admin-account.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
501
gen/go/admin/admin-account_grpc.pb.go
Normal file
501
gen/go/admin/admin-account_grpc.pb.go
Normal file
@@ -0,0 +1,501 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v4.25.9
|
||||
// source: admin/admin-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 (
|
||||
AdminAccountService_AdminResetPassword_FullMethodName = "/admin.account.v1.AdminAccountService/AdminResetPassword"
|
||||
AdminAccountService_CreateUser_FullMethodName = "/admin.account.v1.AdminAccountService/CreateUser"
|
||||
AdminAccountService_DeleteUser_FullMethodName = "/admin.account.v1.AdminAccountService/DeleteUser"
|
||||
AdminAccountService_ChangeData_FullMethodName = "/admin.account.v1.AdminAccountService/ChangeData"
|
||||
AdminAccountService_AssignRole_FullMethodName = "/admin.account.v1.AdminAccountService/AssignRole"
|
||||
AdminAccountService_RevokeRole_FullMethodName = "/admin.account.v1.AdminAccountService/RevokeRole"
|
||||
AdminAccountService_BlockUser_FullMethodName = "/admin.account.v1.AdminAccountService/BlockUser"
|
||||
AdminAccountService_UnblockUser_FullMethodName = "/admin.account.v1.AdminAccountService/UnblockUser"
|
||||
AdminAccountService_BlockIp_FullMethodName = "/admin.account.v1.AdminAccountService/BlockIp"
|
||||
AdminAccountService_UnblockIp_FullMethodName = "/admin.account.v1.AdminAccountService/UnblockIp"
|
||||
AdminAccountService_SyncUsersToSearch_FullMethodName = "/admin.account.v1.AdminAccountService/SyncUsersToSearch"
|
||||
)
|
||||
|
||||
// AdminAccountServiceClient is the client API for AdminAccountService 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 AdminAccountServiceClient interface {
|
||||
AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
|
||||
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
|
||||
ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error)
|
||||
AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error)
|
||||
RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error)
|
||||
BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error)
|
||||
UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error)
|
||||
BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error)
|
||||
UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error)
|
||||
SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error)
|
||||
}
|
||||
|
||||
type adminAccountServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAdminAccountServiceClient(cc grpc.ClientConnInterface) AdminAccountServiceClient {
|
||||
return &adminAccountServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AdminResetPasswordResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_AdminResetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateUserResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteUserResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_DeleteUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeDataResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_ChangeData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AssignRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_AssignRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokeRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_RevokeRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BlockUserResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_BlockUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UnblockUserResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_UnblockUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BlockIpResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_BlockIp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UnblockIpResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_UnblockIp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *adminAccountServiceClient) SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SyncUsersToSearchResponse)
|
||||
err := c.cc.Invoke(ctx, AdminAccountService_SyncUsersToSearch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AdminAccountServiceServer is the server API for AdminAccountService service.
|
||||
// All implementations must embed UnimplementedAdminAccountServiceServer
|
||||
// for forward compatibility.
|
||||
type AdminAccountServiceServer interface {
|
||||
AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error)
|
||||
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
|
||||
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
|
||||
ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error)
|
||||
AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error)
|
||||
RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error)
|
||||
BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error)
|
||||
UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error)
|
||||
BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error)
|
||||
UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error)
|
||||
SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error)
|
||||
mustEmbedUnimplementedAdminAccountServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAdminAccountServiceServer 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 UnimplementedAdminAccountServiceServer struct{}
|
||||
|
||||
func (UnimplementedAdminAccountServiceServer) AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AdminResetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeData not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AssignRole not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokeRole not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BlockUser not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnblockUser not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BlockIp not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnblockIp not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SyncUsersToSearch not implemented")
|
||||
}
|
||||
func (UnimplementedAdminAccountServiceServer) mustEmbedUnimplementedAdminAccountServiceServer() {}
|
||||
func (UnimplementedAdminAccountServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAdminAccountServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AdminAccountServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAdminAccountServiceServer interface {
|
||||
mustEmbedUnimplementedAdminAccountServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAdminAccountServiceServer(s grpc.ServiceRegistrar, srv AdminAccountServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedAdminAccountServiceServer 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(&AdminAccountService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AdminAccountService_AdminResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AdminResetPasswordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).AdminResetPassword(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_AdminResetPassword_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).AdminResetPassword(ctx, req.(*AdminResetPasswordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).DeleteUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_DeleteUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_ChangeData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangeDataRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).ChangeData(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_ChangeData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).ChangeData(ctx, req.(*ChangeDataRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_AssignRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AssignRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).AssignRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_AssignRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).AssignRole(ctx, req.(*AssignRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_RevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokeRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).RevokeRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_RevokeRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).RevokeRole(ctx, req.(*RevokeRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BlockUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).BlockUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_BlockUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).BlockUser(ctx, req.(*BlockUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_UnblockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnblockUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).UnblockUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_UnblockUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).UnblockUser(ctx, req.(*UnblockUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_BlockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BlockIpRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).BlockIp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_BlockIp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).BlockIp(ctx, req.(*BlockIpRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_UnblockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnblockIpRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).UnblockIp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_UnblockIp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).UnblockIp(ctx, req.(*UnblockIpRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AdminAccountService_SyncUsersToSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncUsersToSearchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AdminAccountServiceServer).SyncUsersToSearch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AdminAccountService_SyncUsersToSearch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AdminAccountServiceServer).SyncUsersToSearch(ctx, req.(*SyncUsersToSearchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AdminAccountService_ServiceDesc is the grpc.ServiceDesc for AdminAccountService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AdminAccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "admin.account.v1.AdminAccountService",
|
||||
HandlerType: (*AdminAccountServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AdminResetPassword",
|
||||
Handler: _AdminAccountService_AdminResetPassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _AdminAccountService_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteUser",
|
||||
Handler: _AdminAccountService_DeleteUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangeData",
|
||||
Handler: _AdminAccountService_ChangeData_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AssignRole",
|
||||
Handler: _AdminAccountService_AssignRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokeRole",
|
||||
Handler: _AdminAccountService_RevokeRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BlockUser",
|
||||
Handler: _AdminAccountService_BlockUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnblockUser",
|
||||
Handler: _AdminAccountService_UnblockUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BlockIp",
|
||||
Handler: _AdminAccountService_BlockIp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnblockIp",
|
||||
Handler: _AdminAccountService_UnblockIp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SyncUsersToSearch",
|
||||
Handler: _AdminAccountService_SyncUsersToSearch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "admin/admin-account.proto",
|
||||
}
|
||||
975
gen/go/admin/rbac.pb.go
Normal file
975
gen/go/admin/rbac.pb.go
Normal file
@@ -0,0 +1,975 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.9
|
||||
// source: admin/rbac.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 GetAllPermissionsRequest 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 *GetAllPermissionsRequest) Reset() {
|
||||
*x = GetAllPermissionsRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAllPermissionsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetAllPermissionsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 GetAllPermissionsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetAllPermissionsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsRequest) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetAllPermissionsResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsResponse) Reset() {
|
||||
*x = GetAllPermissionsResponse{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAllPermissionsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetAllPermissionsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 GetAllPermissionsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetAllPermissionsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetAllPermissionsResponse) GetPermissions() []*Permission {
|
||||
if x != nil {
|
||||
return x.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Permission struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Module string `protobuf:"bytes,4,opt,name=module,proto3" json:"module,omitempty"`
|
||||
Roles []string `protobuf:"bytes,5,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Permission) Reset() {
|
||||
*x = Permission{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Permission) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Permission) ProtoMessage() {}
|
||||
|
||||
func (x *Permission) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 Permission.ProtoReflect.Descriptor instead.
|
||||
func (*Permission) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Permission) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetModule() string {
|
||||
if x != nil {
|
||||
return x.Module
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Permission) GetRoles() []string {
|
||||
if x != nil {
|
||||
return x.Roles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetAllRolesRequest 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 *GetAllRolesRequest) Reset() {
|
||||
*x = GetAllRolesRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAllRolesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAllRolesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetAllRolesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 GetAllRolesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetAllRolesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *GetAllRolesRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetAllRolesRequest) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetAllRolesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Roles []*Roles `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetAllRolesResponse) Reset() {
|
||||
*x = GetAllRolesResponse{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetAllRolesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetAllRolesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetAllRolesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 GetAllRolesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetAllRolesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetAllRolesResponse) GetRoles() []*Roles {
|
||||
if x != nil {
|
||||
return x.Roles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreateRoleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
|
||||
PermissionCodes []string `protobuf:"bytes,3,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateRoleRequest) Reset() {
|
||||
*x = CreateRoleRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateRoleRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateRoleRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 CreateRoleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreateRoleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *CreateRoleRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreateRoleRequest) GetLevel() int32 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CreateRoleRequest) GetPermissionCodes() []string {
|
||||
if x != nil {
|
||||
return x.PermissionCodes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateRoleRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
|
||||
Level *int32 `protobuf:"varint,3,opt,name=level,proto3,oneof" json:"level,omitempty"`
|
||||
PermissionCodes []string `protobuf:"bytes,4,rep,name=permission_codes,json=permissionCodes,proto3" json:"permission_codes,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) Reset() {
|
||||
*x = UpdateRoleRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateRoleRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 UpdateRoleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateRoleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) GetName() string {
|
||||
if x != nil && x.Name != nil {
|
||||
return *x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) GetLevel() int32 {
|
||||
if x != nil && x.Level != nil {
|
||||
return *x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *UpdateRoleRequest) GetPermissionCodes() []string {
|
||||
if x != nil {
|
||||
return x.PermissionCodes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ModifyRoleResponse 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 *ModifyRoleResponse) Reset() {
|
||||
*x = ModifyRoleResponse{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ModifyRoleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModifyRoleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ModifyRoleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 ModifyRoleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ModifyRoleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *ModifyRoleResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ModifyRoleResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteRoleRequest 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 *DeleteRoleRequest) Reset() {
|
||||
*x = DeleteRoleRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteRoleRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteRoleRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 DeleteRoleRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteRoleRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *DeleteRoleRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteRoleResponse 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"`
|
||||
FallbackRoleName *string `protobuf:"bytes,3,opt,name=fallback_role_name,json=fallbackRoleName,proto3,oneof" json:"fallback_role_name,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeleteRoleResponse) Reset() {
|
||||
*x = DeleteRoleResponse{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeleteRoleResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteRoleResponse) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteRoleResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 DeleteRoleResponse.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteRoleResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *DeleteRoleResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *DeleteRoleResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DeleteRoleResponse) GetFallbackRoleName() string {
|
||||
if x != nil && x.FallbackRoleName != nil {
|
||||
return *x.FallbackRoleName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreatePermissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Module string `protobuf:"bytes,3,opt,name=module,proto3" json:"module,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreatePermissionRequest) Reset() {
|
||||
*x = CreatePermissionRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreatePermissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreatePermissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreatePermissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 CreatePermissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreatePermissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
func (x *CreatePermissionRequest) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreatePermissionRequest) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CreatePermissionRequest) GetModule() string {
|
||||
if x != nil {
|
||||
return x.Module
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type UpdatePermissionRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
RoleIds []string `protobuf:"bytes,2,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` // Привязка к конкретным ролям
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UpdatePermissionRequest) Reset() {
|
||||
*x = UpdatePermissionRequest{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[11]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UpdatePermissionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdatePermissionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *UpdatePermissionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_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 UpdatePermissionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{11}
|
||||
}
|
||||
|
||||
func (x *UpdatePermissionRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UpdatePermissionRequest) GetRoleIds() []string {
|
||||
if x != nil {
|
||||
return x.RoleIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ModifyPermissionResponse 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 *ModifyPermissionResponse) Reset() {
|
||||
*x = ModifyPermissionResponse{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ModifyPermissionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModifyPermissionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ModifyPermissionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_proto_msgTypes[12]
|
||||
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 ModifyPermissionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ModifyPermissionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *ModifyPermissionResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ModifyPermissionResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Roles struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"`
|
||||
Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"`
|
||||
LdapMapping []string `protobuf:"bytes,5,rep,name=ldap_mapping,json=ldapMapping,proto3" json:"ldap_mapping,omitempty"`
|
||||
Accounts []string `protobuf:"bytes,6,rep,name=accounts,proto3" json:"accounts,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *Roles) Reset() {
|
||||
*x = Roles{}
|
||||
mi := &file_admin_rbac_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *Roles) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Roles) ProtoMessage() {}
|
||||
|
||||
func (x *Roles) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_admin_rbac_proto_msgTypes[13]
|
||||
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 Roles.ProtoReflect.Descriptor instead.
|
||||
func (*Roles) Descriptor() ([]byte, []int) {
|
||||
return file_admin_rbac_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *Roles) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Roles) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Roles) GetLevel() int32 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Roles) GetPermissions() []string {
|
||||
if x != nil {
|
||||
return x.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Roles) GetLdapMapping() []string {
|
||||
if x != nil {
|
||||
return x.LdapMapping
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Roles) GetAccounts() []string {
|
||||
if x != nil {
|
||||
return x.Accounts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_admin_rbac_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_admin_rbac_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x10admin/rbac.proto\x12\arbac.v1\"R\n" +
|
||||
"\x18GetAllPermissionsRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x02 \x01(\tR\tsessionId\"R\n" +
|
||||
"\x19GetAllPermissionsResponse\x125\n" +
|
||||
"\vpermissions\x18\x01 \x03(\v2\x13.rbac.v1.PermissionR\vpermissions\"\x80\x01\n" +
|
||||
"\n" +
|
||||
"Permission\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04code\x18\x02 \x01(\tR\x04code\x12 \n" +
|
||||
"\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" +
|
||||
"\x06module\x18\x04 \x01(\tR\x06module\x12\x14\n" +
|
||||
"\x05roles\x18\x05 \x03(\tR\x05roles\"L\n" +
|
||||
"\x12GetAllRolesRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x02 \x01(\tR\tsessionId\";\n" +
|
||||
"\x13GetAllRolesResponse\x12$\n" +
|
||||
"\x05roles\x18\x01 \x03(\v2\x0e.rbac.v1.RolesR\x05roles\"h\n" +
|
||||
"\x11CreateRoleRequest\x12\x12\n" +
|
||||
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
|
||||
"\x05level\x18\x02 \x01(\x05R\x05level\x12)\n" +
|
||||
"\x10permission_codes\x18\x03 \x03(\tR\x0fpermissionCodes\"\x95\x01\n" +
|
||||
"\x11UpdateRoleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n" +
|
||||
"\x04name\x18\x02 \x01(\tH\x00R\x04name\x88\x01\x01\x12\x19\n" +
|
||||
"\x05level\x18\x03 \x01(\x05H\x01R\x05level\x88\x01\x01\x12)\n" +
|
||||
"\x10permission_codes\x18\x04 \x03(\tR\x0fpermissionCodesB\a\n" +
|
||||
"\x05_nameB\b\n" +
|
||||
"\x06_level\"H\n" +
|
||||
"\x12ModifyRoleResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"#\n" +
|
||||
"\x11DeleteRoleRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"\x92\x01\n" +
|
||||
"\x12DeleteRoleResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\x121\n" +
|
||||
"\x12fallback_role_name\x18\x03 \x01(\tH\x00R\x10fallbackRoleName\x88\x01\x01B\x15\n" +
|
||||
"\x13_fallback_role_name\"g\n" +
|
||||
"\x17CreatePermissionRequest\x12\x12\n" +
|
||||
"\x04code\x18\x01 \x01(\tR\x04code\x12 \n" +
|
||||
"\vdescription\x18\x02 \x01(\tR\vdescription\x12\x16\n" +
|
||||
"\x06module\x18\x03 \x01(\tR\x06module\"D\n" +
|
||||
"\x17UpdatePermissionRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" +
|
||||
"\brole_ids\x18\x02 \x03(\tR\aroleIds\"N\n" +
|
||||
"\x18ModifyPermissionResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"\xa2\x01\n" +
|
||||
"\x05Roles\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||
"\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" +
|
||||
"\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" +
|
||||
"\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" +
|
||||
"\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" +
|
||||
"\baccounts\x18\x06 \x03(\tR\baccounts2\xba\x04\n" +
|
||||
"\vRbacService\x12E\n" +
|
||||
"\n" +
|
||||
"CreateRole\x12\x1a.rbac.v1.CreateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" +
|
||||
"\n" +
|
||||
"UpdateRole\x12\x1a.rbac.v1.UpdateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" +
|
||||
"\n" +
|
||||
"DeleteRole\x12\x1a.rbac.v1.DeleteRoleRequest\x1a\x1b.rbac.v1.DeleteRoleResponse\x12W\n" +
|
||||
"\x10CreatePermission\x12 .rbac.v1.CreatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12W\n" +
|
||||
"\x10UpdatePermission\x12 .rbac.v1.UpdatePermissionRequest\x1a!.rbac.v1.ModifyPermissionResponse\x12Z\n" +
|
||||
"\x11GetAllPermissions\x12!.rbac.v1.GetAllPermissionsRequest\x1a\".rbac.v1.GetAllPermissionsResponse\x12H\n" +
|
||||
"\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_admin_rbac_proto_rawDescOnce sync.Once
|
||||
file_admin_rbac_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_admin_rbac_proto_rawDescGZIP() []byte {
|
||||
file_admin_rbac_proto_rawDescOnce.Do(func() {
|
||||
file_admin_rbac_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_admin_rbac_proto_rawDesc), len(file_admin_rbac_proto_rawDesc)))
|
||||
})
|
||||
return file_admin_rbac_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_admin_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
|
||||
var file_admin_rbac_proto_goTypes = []any{
|
||||
(*GetAllPermissionsRequest)(nil), // 0: rbac.v1.GetAllPermissionsRequest
|
||||
(*GetAllPermissionsResponse)(nil), // 1: rbac.v1.GetAllPermissionsResponse
|
||||
(*Permission)(nil), // 2: rbac.v1.Permission
|
||||
(*GetAllRolesRequest)(nil), // 3: rbac.v1.GetAllRolesRequest
|
||||
(*GetAllRolesResponse)(nil), // 4: rbac.v1.GetAllRolesResponse
|
||||
(*CreateRoleRequest)(nil), // 5: rbac.v1.CreateRoleRequest
|
||||
(*UpdateRoleRequest)(nil), // 6: rbac.v1.UpdateRoleRequest
|
||||
(*ModifyRoleResponse)(nil), // 7: rbac.v1.ModifyRoleResponse
|
||||
(*DeleteRoleRequest)(nil), // 8: rbac.v1.DeleteRoleRequest
|
||||
(*DeleteRoleResponse)(nil), // 9: rbac.v1.DeleteRoleResponse
|
||||
(*CreatePermissionRequest)(nil), // 10: rbac.v1.CreatePermissionRequest
|
||||
(*UpdatePermissionRequest)(nil), // 11: rbac.v1.UpdatePermissionRequest
|
||||
(*ModifyPermissionResponse)(nil), // 12: rbac.v1.ModifyPermissionResponse
|
||||
(*Roles)(nil), // 13: rbac.v1.Roles
|
||||
}
|
||||
var file_admin_rbac_proto_depIdxs = []int32{
|
||||
2, // 0: rbac.v1.GetAllPermissionsResponse.permissions:type_name -> rbac.v1.Permission
|
||||
13, // 1: rbac.v1.GetAllRolesResponse.roles:type_name -> rbac.v1.Roles
|
||||
5, // 2: rbac.v1.RbacService.CreateRole:input_type -> rbac.v1.CreateRoleRequest
|
||||
6, // 3: rbac.v1.RbacService.UpdateRole:input_type -> rbac.v1.UpdateRoleRequest
|
||||
8, // 4: rbac.v1.RbacService.DeleteRole:input_type -> rbac.v1.DeleteRoleRequest
|
||||
10, // 5: rbac.v1.RbacService.CreatePermission:input_type -> rbac.v1.CreatePermissionRequest
|
||||
11, // 6: rbac.v1.RbacService.UpdatePermission:input_type -> rbac.v1.UpdatePermissionRequest
|
||||
0, // 7: rbac.v1.RbacService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest
|
||||
3, // 8: rbac.v1.RbacService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest
|
||||
7, // 9: rbac.v1.RbacService.CreateRole:output_type -> rbac.v1.ModifyRoleResponse
|
||||
7, // 10: rbac.v1.RbacService.UpdateRole:output_type -> rbac.v1.ModifyRoleResponse
|
||||
9, // 11: rbac.v1.RbacService.DeleteRole:output_type -> rbac.v1.DeleteRoleResponse
|
||||
12, // 12: rbac.v1.RbacService.CreatePermission:output_type -> rbac.v1.ModifyPermissionResponse
|
||||
12, // 13: rbac.v1.RbacService.UpdatePermission:output_type -> rbac.v1.ModifyPermissionResponse
|
||||
1, // 14: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
|
||||
4, // 15: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
|
||||
9, // [9:16] is the sub-list for method output_type
|
||||
2, // [2:9] 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_admin_rbac_proto_init() }
|
||||
func file_admin_rbac_proto_init() {
|
||||
if File_admin_rbac_proto != nil {
|
||||
return
|
||||
}
|
||||
file_admin_rbac_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
file_admin_rbac_proto_msgTypes[9].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_rbac_proto_rawDesc), len(file_admin_rbac_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 14,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_admin_rbac_proto_goTypes,
|
||||
DependencyIndexes: file_admin_rbac_proto_depIdxs,
|
||||
MessageInfos: file_admin_rbac_proto_msgTypes,
|
||||
}.Build()
|
||||
File_admin_rbac_proto = out.File
|
||||
file_admin_rbac_proto_goTypes = nil
|
||||
file_admin_rbac_proto_depIdxs = nil
|
||||
}
|
||||
349
gen/go/admin/rbac_grpc.pb.go
Normal file
349
gen/go/admin/rbac_grpc.pb.go
Normal file
@@ -0,0 +1,349 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v4.25.9
|
||||
// source: admin/rbac.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 (
|
||||
RbacService_CreateRole_FullMethodName = "/rbac.v1.RbacService/CreateRole"
|
||||
RbacService_UpdateRole_FullMethodName = "/rbac.v1.RbacService/UpdateRole"
|
||||
RbacService_DeleteRole_FullMethodName = "/rbac.v1.RbacService/DeleteRole"
|
||||
RbacService_CreatePermission_FullMethodName = "/rbac.v1.RbacService/CreatePermission"
|
||||
RbacService_UpdatePermission_FullMethodName = "/rbac.v1.RbacService/UpdatePermission"
|
||||
RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions"
|
||||
RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles"
|
||||
)
|
||||
|
||||
// RbacServiceClient is the client API for RbacService 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 RbacServiceClient interface {
|
||||
CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
|
||||
UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
|
||||
DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error)
|
||||
CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error)
|
||||
UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error)
|
||||
GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error)
|
||||
GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error)
|
||||
}
|
||||
|
||||
type rbacServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRbacServiceClient(cc grpc.ClientConnInterface) RbacServiceClient {
|
||||
return &rbacServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ModifyRoleResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_CreateRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ModifyRoleResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_UpdateRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*DeleteRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteRoleResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_DeleteRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ModifyPermissionResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_CreatePermission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*ModifyPermissionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ModifyPermissionResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_UpdatePermission_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAllPermissionsResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_GetAllPermissions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *rbacServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetAllRolesResponse)
|
||||
err := c.cc.Invoke(ctx, RbacService_GetAllRoles_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RbacServiceServer is the server API for RbacService service.
|
||||
// All implementations must embed UnimplementedRbacServiceServer
|
||||
// for forward compatibility.
|
||||
type RbacServiceServer interface {
|
||||
CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error)
|
||||
UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error)
|
||||
DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error)
|
||||
CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error)
|
||||
UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error)
|
||||
GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error)
|
||||
GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
|
||||
mustEmbedUnimplementedRbacServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedRbacServiceServer 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 UnimplementedRbacServiceServer struct{}
|
||||
|
||||
func (UnimplementedRbacServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*ModifyRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) UpdateRole(context.Context, *UpdateRoleRequest) (*ModifyRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) DeleteRole(context.Context, *DeleteRoleRequest) (*DeleteRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) CreatePermission(context.Context, *CreatePermissionRequest) (*ModifyPermissionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreatePermission not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdatePermission not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented")
|
||||
}
|
||||
func (UnimplementedRbacServiceServer) mustEmbedUnimplementedRbacServiceServer() {}
|
||||
func (UnimplementedRbacServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRbacServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RbacServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRbacServiceServer interface {
|
||||
mustEmbedUnimplementedRbacServiceServer()
|
||||
}
|
||||
|
||||
func RegisterRbacServiceServer(s grpc.ServiceRegistrar, srv RbacServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedRbacServiceServer 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(&RbacService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RbacService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).CreateRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_CreateRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).CreateRole(ctx, req.(*CreateRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).UpdateRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_UpdateRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).UpdateRole(ctx, req.(*UpdateRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).DeleteRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_DeleteRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).DeleteRole(ctx, req.(*DeleteRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_CreatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreatePermissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).CreatePermission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_CreatePermission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).CreatePermission(ctx, req.(*CreatePermissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdatePermissionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).UpdatePermission(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_UpdatePermission_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).UpdatePermission(ctx, req.(*UpdatePermissionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAllPermissionsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).GetAllPermissions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_GetAllPermissions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).GetAllPermissions(ctx, req.(*GetAllPermissionsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RbacService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetAllRolesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RbacServiceServer).GetAllRoles(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RbacService_GetAllRoles_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RbacServiceServer).GetAllRoles(ctx, req.(*GetAllRolesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RbacService_ServiceDesc is the grpc.ServiceDesc for RbacService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RbacService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "rbac.v1.RbacService",
|
||||
HandlerType: (*RbacServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateRole",
|
||||
Handler: _RbacService_CreateRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateRole",
|
||||
Handler: _RbacService_UpdateRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteRole",
|
||||
Handler: _RbacService_DeleteRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreatePermission",
|
||||
Handler: _RbacService_CreatePermission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdatePermission",
|
||||
Handler: _RbacService_UpdatePermission_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAllPermissions",
|
||||
Handler: _RbacService_GetAllPermissions_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAllRoles",
|
||||
Handler: _RbacService_GetAllRoles_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "admin/rbac.proto",
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,21 +21,10 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
const (
|
||||
AccountService_GetAccount_FullMethodName = "/account.v1.AccountService/GetAccount"
|
||||
AccountService_ChangePassword_FullMethodName = "/account.v1.AccountService/ChangePassword"
|
||||
AccountService_AdminResetPassword_FullMethodName = "/account.v1.AccountService/AdminResetPassword"
|
||||
AccountService_CreateUser_FullMethodName = "/account.v1.AccountService/CreateUser"
|
||||
AccountService_DeleteUser_FullMethodName = "/account.v1.AccountService/DeleteUser"
|
||||
AccountService_ChangeData_FullMethodName = "/account.v1.AccountService/ChangeData"
|
||||
AccountService_AssignRole_FullMethodName = "/account.v1.AccountService/AssignRole"
|
||||
AccountService_RevokeRole_FullMethodName = "/account.v1.AccountService/RevokeRole"
|
||||
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"
|
||||
AccountService_BlockUser_FullMethodName = "/account.v1.AccountService/BlockUser"
|
||||
AccountService_UnblockUser_FullMethodName = "/account.v1.AccountService/UnblockUser"
|
||||
AccountService_BlockIp_FullMethodName = "/account.v1.AccountService/BlockIp"
|
||||
AccountService_UnblockIp_FullMethodName = "/account.v1.AccountService/UnblockIp"
|
||||
AccountService_SyncUsersToSearch_FullMethodName = "/account.v1.AccountService/SyncUsersToSearch"
|
||||
)
|
||||
|
||||
// AccountServiceClient is the client API for AccountService service.
|
||||
@@ -44,21 +33,10 @@ const (
|
||||
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)
|
||||
AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
|
||||
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
|
||||
ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error)
|
||||
AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error)
|
||||
RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, 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)
|
||||
BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error)
|
||||
UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error)
|
||||
BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error)
|
||||
UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error)
|
||||
SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error)
|
||||
}
|
||||
|
||||
type accountServiceClient struct {
|
||||
@@ -89,66 +67,6 @@ func (c *accountServiceClient) ChangePassword(ctx context.Context, in *ChangePas
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) AdminResetPassword(ctx context.Context, in *AdminResetPasswordRequest, opts ...grpc.CallOption) (*AdminResetPasswordResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AdminResetPasswordResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_AdminResetPassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateUserResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteUserResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_DeleteUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) ChangeData(ctx context.Context, in *ChangeDataRequest, opts ...grpc.CallOption) (*ChangeDataResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeDataResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_ChangeData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) AssignRole(ctx context.Context, in *AssignRoleRequest, opts ...grpc.CallOption) (*AssignRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AssignRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_AssignRole_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) RevokeRole(ctx context.Context, in *RevokeRoleRequest, opts ...grpc.CallOption) (*RevokeRoleResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RevokeRoleResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_RevokeRole_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)
|
||||
@@ -189,77 +107,16 @@ func (c *accountServiceClient) RemovePin(ctx context.Context, in *RemovePinReque
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BlockUserResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_BlockUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UnblockUserResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_UnblockUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) BlockIp(ctx context.Context, in *BlockIpRequest, opts ...grpc.CallOption) (*BlockIpResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BlockIpResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_BlockIp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UnblockIpResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_UnblockIp_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *accountServiceClient) SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SyncUsersToSearchResponse)
|
||||
err := c.cc.Invoke(ctx, AccountService_SyncUsersToSearch_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)
|
||||
AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error)
|
||||
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
|
||||
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
|
||||
ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error)
|
||||
AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error)
|
||||
RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, 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)
|
||||
BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error)
|
||||
UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error)
|
||||
BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error)
|
||||
UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error)
|
||||
SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error)
|
||||
mustEmbedUnimplementedAccountServiceServer()
|
||||
}
|
||||
|
||||
@@ -276,24 +133,6 @@ func (UnimplementedAccountServiceServer) GetAccount(context.Context, *GetAccount
|
||||
func (UnimplementedAccountServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangePassword not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) AdminResetPassword(context.Context, *AdminResetPasswordRequest) (*AdminResetPasswordResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AdminResetPassword not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) ChangeData(context.Context, *ChangeDataRequest) (*ChangeDataResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeData not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) AssignRole(context.Context, *AssignRoleRequest) (*AssignRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AssignRole not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) RevokeRole(context.Context, *RevokeRoleRequest) (*RevokeRoleResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RevokeRole not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SetPin(context.Context, *SetPinRequest) (*SetPinResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetPin not implemented")
|
||||
}
|
||||
@@ -306,21 +145,6 @@ func (UnimplementedAccountServiceServer) GetPinStatus(context.Context, *GetPinSt
|
||||
func (UnimplementedAccountServiceServer) RemovePin(context.Context, *RemovePinRequest) (*RemovePinResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemovePin not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BlockUser not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnblockUser not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) BlockIp(context.Context, *BlockIpRequest) (*BlockIpResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method BlockIp not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UnblockIp not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SyncUsersToSearch not implemented")
|
||||
}
|
||||
func (UnimplementedAccountServiceServer) mustEmbedUnimplementedAccountServiceServer() {}
|
||||
func (UnimplementedAccountServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -378,114 +202,6 @@ func _AccountService_ChangePassword_Handler(srv interface{}, ctx context.Context
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_AdminResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AdminResetPasswordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).AdminResetPassword(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_AdminResetPassword_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).AdminResetPassword(ctx, req.(*AdminResetPasswordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).DeleteUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_DeleteUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_ChangeData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangeDataRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).ChangeData(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_ChangeData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).ChangeData(ctx, req.(*ChangeDataRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_AssignRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AssignRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).AssignRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_AssignRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).AssignRole(ctx, req.(*AssignRoleRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_RevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevokeRoleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).RevokeRole(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_RevokeRole_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).RevokeRole(ctx, req.(*RevokeRoleRequest))
|
||||
}
|
||||
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 {
|
||||
@@ -558,96 +274,6 @@ func _AccountService_RemovePin_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BlockUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).BlockUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_BlockUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).BlockUser(ctx, req.(*BlockUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_UnblockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnblockUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).UnblockUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_UnblockUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).UnblockUser(ctx, req.(*UnblockUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_BlockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BlockIpRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).BlockIp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_BlockIp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).BlockIp(ctx, req.(*BlockIpRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_UnblockIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UnblockIpRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).UnblockIp(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_UnblockIp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).UnblockIp(ctx, req.(*UnblockIpRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AccountService_SyncUsersToSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SyncUsersToSearchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AccountServiceServer).SyncUsersToSearch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AccountService_SyncUsersToSearch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AccountServiceServer).SyncUsersToSearch(ctx, req.(*SyncUsersToSearchRequest))
|
||||
}
|
||||
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)
|
||||
@@ -663,30 +289,6 @@ var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ChangePassword",
|
||||
Handler: _AccountService_ChangePassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AdminResetPassword",
|
||||
Handler: _AccountService_AdminResetPassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _AccountService_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteUser",
|
||||
Handler: _AccountService_DeleteUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangeData",
|
||||
Handler: _AccountService_ChangeData_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AssignRole",
|
||||
Handler: _AccountService_AssignRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevokeRole",
|
||||
Handler: _AccountService_RevokeRole_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetPin",
|
||||
Handler: _AccountService_SetPin_Handler,
|
||||
@@ -703,26 +305,6 @@ var AccountService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "RemovePin",
|
||||
Handler: _AccountService_RemovePin_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BlockUser",
|
||||
Handler: _AccountService_BlockUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnblockUser",
|
||||
Handler: _AccountService_UnblockUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BlockIp",
|
||||
Handler: _AccountService_BlockIp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UnblockIp",
|
||||
Handler: _AccountService_UnblockIp_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SyncUsersToSearch",
|
||||
Handler: _AccountService_SyncUsersToSearch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "sso/account.proto",
|
||||
|
||||
846
gen/go/users/ldap.pb.go
Normal file
846
gen/go/users/ldap.pb.go
Normal file
@@ -0,0 +1,846 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.9
|
||||
// source: users/ldap.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 EmptyRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *EmptyRequest) Reset() {
|
||||
*x = EmptyRequest{}
|
||||
mi := &file_users_ldap_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *EmptyRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EmptyRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EmptyRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_ldap_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 EmptyRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EmptyRequest) Descriptor() ([]byte, []int) {
|
||||
return file_users_ldap_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// Стандартный ответ для мутаций (создание, обновление, удаление)
|
||||
type StatusResponse 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"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *StatusResponse) Reset() {
|
||||
*x = StatusResponse{}
|
||||
mi := &file_users_ldap_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *StatusResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StatusResponse) ProtoMessage() {}
|
||||
|
||||
func (x *StatusResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_ldap_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 StatusResponse.ProtoReflect.Descriptor instead.
|
||||
func (*StatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_users_ldap_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetErrorMessage() string {
|
||||
if x != nil {
|
||||
return x.ErrorMessage
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Полная модель пользователя
|
||||
type UserData struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Dn string `protobuf:"bytes,1,opt,name=dn,proto3" json:"dn,omitempty"` // Полный путь в AD (Distinguished Name)
|
||||
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // Логин (sAMAccountName)
|
||||
DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // ФИО (displayName)
|
||||
Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // Почта (mail)
|
||||
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` // Описание/Должность (description)
|
||||
Avatar []byte `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar,omitempty"` // Аватарка в байтах (thumbnailPhoto)
|
||||
Groups []string `protobuf:"bytes,7,rep,name=groups,proto3" json:"groups,omitempty"` // Список групп
|
||||
IsActive bool `protobuf:"varint,8,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` // Статус аккаунта
|
||||
Phone string `protobuf:"bytes,9,opt,name=phone,proto3" json:"phone,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *UserData) Reset() {
|
||||
*x = UserData{}
|
||||
mi := &file_users_ldap_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *UserData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UserData) ProtoMessage() {}
|
||||
|
||||
func (x *UserData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_ldap_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 UserData.ProtoReflect.Descriptor instead.
|
||||
func (*UserData) Descriptor() ([]byte, []int) {
|
||||
return file_users_ldap_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *UserData) GetDn() string {
|
||||
if x != nil {
|
||||
return x.Dn
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserData) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserData) GetDisplayName() string {
|
||||
if x != nil {
|
||||
return x.DisplayName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserData) GetEmail() string {
|
||||
if x != nil {
|
||||
return x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserData) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *UserData) GetAvatar() []byte {
|
||||
if x != nil {
|
||||
return x.Avatar
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UserData) GetGroups() []string {
|
||||
if x != nil {
|
||||
return x.Groups
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UserData) GetIsActive() bool {
|
||||
if x != nil {
|
||||
return x.IsActive
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_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_users_ldap_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_users_ldap_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x10users/ldap.proto\x12\aldap.v1\"\x0e\n" +
|
||||
"\fEmptyRequest\"O\n" +
|
||||
"\x0eStatusResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12#\n" +
|
||||
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"\xf4\x01\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" +
|
||||
"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\x12*\n" +
|
||||
"\x06groups\x18\x03 \x03(\v2\x12.ldap.v1.GroupDataR\x06groups\"\x8d\x01\n" +
|
||||
"\x11CreateUserRequest\x12\x1a\n" +
|
||||
"\busername\x18\x01 \x01(\tR\busername\x12\x1b\n" +
|
||||
"\tfull_name\x18\x02 \x01(\tR\bfullName\x12\x1a\n" +
|
||||
"\bpassword\x18\x03 \x01(\tR\bpassword\x12\x19\n" +
|
||||
"\x05email\x18\x04 \x01(\tH\x00R\x05email\x88\x01\x01B\b\n" +
|
||||
"\x06_email\"\xec\x01\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" +
|
||||
"set_active\x18\x02 \x01(\bR\tsetActive\"K\n" +
|
||||
"\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 (
|
||||
file_users_ldap_proto_rawDescOnce sync.Once
|
||||
file_users_ldap_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_users_ldap_proto_rawDescGZIP() []byte {
|
||||
file_users_ldap_proto_rawDescOnce.Do(func() {
|
||||
file_users_ldap_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_users_ldap_proto_rawDesc), len(file_users_ldap_proto_rawDesc)))
|
||||
})
|
||||
return file_users_ldap_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_users_ldap_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_users_ldap_proto_goTypes = []any{
|
||||
(*EmptyRequest)(nil), // 0: ldap.v1.EmptyRequest
|
||||
(*StatusResponse)(nil), // 1: ldap.v1.StatusResponse
|
||||
(*UserData)(nil), // 2: ldap.v1.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_users_ldap_proto_depIdxs = []int32{
|
||||
2, // 0: ldap.v1.UserListResponse.users:type_name -> ldap.v1.UserData
|
||||
3, // 1: ldap.v1.GroupListResponse.groups:type_name -> ldap.v1.GroupData
|
||||
0, // 2: ldap.v1.LdapService.GetUsers:input_type -> ldap.v1.EmptyRequest
|
||||
6, // 3: ldap.v1.LdapService.CreateUser:input_type -> ldap.v1.CreateUserRequest
|
||||
7, // 4: ldap.v1.LdapService.UpdateUser:input_type -> ldap.v1.UpdateUserRequest
|
||||
8, // 5: ldap.v1.LdapService.ChangePassword:input_type -> ldap.v1.ChangePasswordRequest
|
||||
9, // 6: ldap.v1.LdapService.ToggleUserStatus:input_type -> ldap.v1.ToggleStatusRequest
|
||||
0, // 7: ldap.v1.LdapService.GetGroups:input_type -> ldap.v1.EmptyRequest
|
||||
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_users_ldap_proto_init() }
|
||||
func file_users_ldap_proto_init() {
|
||||
if File_users_ldap_proto != nil {
|
||||
return
|
||||
}
|
||||
file_users_ldap_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
file_users_ldap_proto_msgTypes[7].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_ldap_proto_rawDesc), len(file_users_ldap_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_users_ldap_proto_goTypes,
|
||||
DependencyIndexes: file_users_ldap_proto_depIdxs,
|
||||
MessageInfos: file_users_ldap_proto_msgTypes,
|
||||
}.Build()
|
||||
File_users_ldap_proto = out.File
|
||||
file_users_ldap_proto_goTypes = nil
|
||||
file_users_ldap_proto_depIdxs = nil
|
||||
}
|
||||
391
gen/go/users/ldap_grpc.pb.go
Normal file
391
gen/go/users/ldap_grpc.pb.go
Normal file
@@ -0,0 +1,391 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v4.25.9
|
||||
// source: users/ldap.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 (
|
||||
LdapService_GetUsers_FullMethodName = "/ldap.v1.LdapService/GetUsers"
|
||||
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.
|
||||
//
|
||||
// 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 {
|
||||
// Управление Пользователями (Bind системного аккаунта) ---
|
||||
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 {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewLdapServiceClient(cc grpc.ClientConnInterface) LdapServiceClient {
|
||||
return &ldapServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *ldapServiceClient) GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UserListResponse)
|
||||
err := c.cc.Invoke(ctx, LdapService_GetUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
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.
|
||||
type LdapServiceServer interface {
|
||||
// Управление Пользователями (Bind системного аккаунта) ---
|
||||
GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error)
|
||||
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
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedLdapServiceServer struct{}
|
||||
|
||||
func (UnimplementedLdapServiceServer) GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented")
|
||||
}
|
||||
func (UnimplementedLdapServiceServer) CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
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.
|
||||
// Use of this interface is not recommended, as added methods to LdapServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeLdapServiceServer interface {
|
||||
mustEmbedUnimplementedLdapServiceServer()
|
||||
}
|
||||
|
||||
func RegisterLdapServiceServer(s grpc.ServiceRegistrar, srv LdapServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedLdapServiceServer 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(&LdapService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _LdapService_GetUsers_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).GetUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapService_GetUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapServiceServer).GetUsers(ctx, req.(*EmptyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
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,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var LdapService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ldap.v1.LdapService",
|
||||
HandlerType: (*LdapServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetUsers",
|
||||
Handler: _LdapService_GetUsers_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{},
|
||||
Metadata: "users/ldap.proto",
|
||||
}
|
||||
703
gen/go/users/users.pb.go
Normal file
703
gen/go/users/users.pb.go
Normal file
@@ -0,0 +1,703 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.11
|
||||
// protoc v4.25.9
|
||||
// source: users/users.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 GetMeRequest 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 *GetMeRequest) Reset() {
|
||||
*x = GetMeRequest{}
|
||||
mi := &file_users_users_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetMeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 GetMeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetMeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetMeRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetMeResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) Reset() {
|
||||
*x = GetMeResponse{}
|
||||
mi := &file_users_users_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetMeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetMeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 GetMeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetMeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetMeResponse) GetUser() *User {
|
||||
if x != nil {
|
||||
return x.User
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreateUserRequest 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 *CreateUserRequest) Reset() {
|
||||
*x = CreateUserRequest{}
|
||||
mi := &file_users_users_proto_msgTypes[2]
|
||||
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_users_users_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 CreateUserRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreateUserRequest) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *CreateUserRequest) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateUserResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success string `protobuf:"bytes,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *CreateUserResponse) Reset() {
|
||||
*x = CreateUserResponse{}
|
||||
mi := &file_users_users_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *CreateUserResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateUserResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 CreateUserResponse.ProtoReflect.Descriptor instead.
|
||||
func (*CreateUserResponse) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *CreateUserResponse) GetSuccess() string {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ChangeMeRequest 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"`
|
||||
Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"`
|
||||
Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
|
||||
FullName *string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"`
|
||||
AvatarUrl *string `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3,oneof" json:"avatar_url,omitempty"`
|
||||
CustomStatusText *string `protobuf:"bytes,7,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
|
||||
CustomStatusEmoji *string `protobuf:"bytes,8,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
|
||||
Timezone *string `protobuf:"bytes,9,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"`
|
||||
Language *string `protobuf:"bytes,10,opt,name=language,proto3,oneof" json:"language,omitempty"`
|
||||
IsPublic *bool `protobuf:"varint,11,opt,name=is_public,json=isPublic,proto3,oneof" json:"is_public,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) Reset() {
|
||||
*x = ChangeMeRequest{}
|
||||
mi := &file_users_users_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChangeMeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ChangeMeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 ChangeMeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ChangeMeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetUserId() string {
|
||||
if x != nil {
|
||||
return x.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetSessionId() string {
|
||||
if x != nil {
|
||||
return x.SessionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetEmail() string {
|
||||
if x != nil && x.Email != nil {
|
||||
return *x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetPhone() string {
|
||||
if x != nil && x.Phone != nil {
|
||||
return *x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetFullName() string {
|
||||
if x != nil && x.FullName != nil {
|
||||
return *x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetAvatarUrl() string {
|
||||
if x != nil && x.AvatarUrl != nil {
|
||||
return *x.AvatarUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetCustomStatusText() string {
|
||||
if x != nil && x.CustomStatusText != nil {
|
||||
return *x.CustomStatusText
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetCustomStatusEmoji() string {
|
||||
if x != nil && x.CustomStatusEmoji != nil {
|
||||
return *x.CustomStatusEmoji
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetTimezone() string {
|
||||
if x != nil && x.Timezone != nil {
|
||||
return *x.Timezone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetLanguage() string {
|
||||
if x != nil && x.Language != nil {
|
||||
return *x.Language
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ChangeMeRequest) GetIsPublic() bool {
|
||||
if x != nil && x.IsPublic != nil {
|
||||
return *x.IsPublic
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ChangeMeResponse 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 *ChangeMeResponse) Reset() {
|
||||
*x = ChangeMeResponse{}
|
||||
mi := &file_users_users_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ChangeMeResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ChangeMeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ChangeMeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 ChangeMeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ChangeMeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ChangeMeResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ChangeMeResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type User 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,oneof" json:"username,omitempty"`
|
||||
Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"`
|
||||
Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"`
|
||||
FullName *string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3,oneof" 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,oneof" 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,oneof" 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,oneof" json:"presence,omitempty"`
|
||||
LastActive *string `protobuf:"bytes,12,opt,name=last_active,json=lastActive,proto3,oneof" json:"last_active,omitempty"`
|
||||
CustomStatusText *string `protobuf:"bytes,13,opt,name=custom_status_text,json=customStatusText,proto3,oneof" json:"custom_status_text,omitempty"`
|
||||
CustomStatusEmoji *string `protobuf:"bytes,14,opt,name=custom_status_emoji,json=customStatusEmoji,proto3,oneof" json:"custom_status_emoji,omitempty"`
|
||||
Timezone *string `protobuf:"bytes,15,opt,name=timezone,proto3,oneof" json:"timezone,omitempty"`
|
||||
Language *string `protobuf:"bytes,16,opt,name=language,proto3,oneof" 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 *User) Reset() {
|
||||
*x = User{}
|
||||
mi := &file_users_users_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *User) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*User) ProtoMessage() {}
|
||||
|
||||
func (x *User) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_users_users_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 User.ProtoReflect.Descriptor instead.
|
||||
func (*User) Descriptor() ([]byte, []int) {
|
||||
return file_users_users_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *User) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetUsername() string {
|
||||
if x != nil && x.Username != nil {
|
||||
return *x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetEmail() string {
|
||||
if x != nil && x.Email != nil {
|
||||
return *x.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetPhone() string {
|
||||
if x != nil && x.Phone != nil {
|
||||
return *x.Phone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetFullName() string {
|
||||
if x != nil && x.FullName != nil {
|
||||
return *x.FullName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetIsLdap() bool {
|
||||
if x != nil {
|
||||
return x.IsLdap
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *User) GetStatus() string {
|
||||
if x != nil && x.Status != nil {
|
||||
return *x.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetRoles() []string {
|
||||
if x != nil {
|
||||
return x.Roles
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *User) GetAvatarUrl() string {
|
||||
if x != nil && x.AvatarUrl != nil {
|
||||
return *x.AvatarUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetEmployeeId() string {
|
||||
if x != nil && x.EmployeeId != nil {
|
||||
return *x.EmployeeId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetPresence() string {
|
||||
if x != nil && x.Presence != nil {
|
||||
return *x.Presence
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetLastActive() string {
|
||||
if x != nil && x.LastActive != nil {
|
||||
return *x.LastActive
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetCustomStatusText() string {
|
||||
if x != nil && x.CustomStatusText != nil {
|
||||
return *x.CustomStatusText
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetCustomStatusEmoji() string {
|
||||
if x != nil && x.CustomStatusEmoji != nil {
|
||||
return *x.CustomStatusEmoji
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetTimezone() string {
|
||||
if x != nil && x.Timezone != nil {
|
||||
return *x.Timezone
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetLanguage() string {
|
||||
if x != nil && x.Language != nil {
|
||||
return *x.Language
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *User) GetTwoFaEnabled() bool {
|
||||
if x != nil {
|
||||
return x.TwoFaEnabled
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *User) GetHasPin() bool {
|
||||
if x != nil {
|
||||
return x.HasPin
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_users_users_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_users_users_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x11users/users.proto\x12\busers.v1\"\x1e\n" +
|
||||
"\fGetMeRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\"3\n" +
|
||||
"\rGetMeResponse\x12\"\n" +
|
||||
"\x04user\x18\x01 \x01(\v2\x0e.users.v1.UserR\x04user\"#\n" +
|
||||
"\x11CreateUserRequest\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\".\n" +
|
||||
"\x12CreateUserResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\tR\asuccess\"\x99\x04\n" +
|
||||
"\x0fChangeMeRequest\x12\x17\n" +
|
||||
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" +
|
||||
"\n" +
|
||||
"session_id\x18\x02 \x01(\tR\tsessionId\x12\x19\n" +
|
||||
"\x05email\x18\x03 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" +
|
||||
"\x05phone\x18\x04 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" +
|
||||
"\tfull_name\x18\x05 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\"\n" +
|
||||
"\n" +
|
||||
"avatar_url\x18\x06 \x01(\tH\x03R\tavatarUrl\x88\x01\x01\x121\n" +
|
||||
"\x12custom_status_text\x18\a \x01(\tH\x04R\x10customStatusText\x88\x01\x01\x123\n" +
|
||||
"\x13custom_status_emoji\x18\b \x01(\tH\x05R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" +
|
||||
"\btimezone\x18\t \x01(\tH\x06R\btimezone\x88\x01\x01\x12\x1f\n" +
|
||||
"\blanguage\x18\n" +
|
||||
" \x01(\tH\aR\blanguage\x88\x01\x01\x12 \n" +
|
||||
"\tis_public\x18\v \x01(\bH\bR\bisPublic\x88\x01\x01B\b\n" +
|
||||
"\x06_emailB\b\n" +
|
||||
"\x06_phoneB\f\n" +
|
||||
"\n" +
|
||||
"_full_nameB\r\n" +
|
||||
"\v_avatar_urlB\x15\n" +
|
||||
"\x13_custom_status_textB\x16\n" +
|
||||
"\x14_custom_status_emojiB\v\n" +
|
||||
"\t_timezoneB\v\n" +
|
||||
"\t_languageB\f\n" +
|
||||
"\n" +
|
||||
"_is_public\"F\n" +
|
||||
"\x10ChangeMeResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
||||
"\amessage\x18\x02 \x01(\tR\amessage\"\x94\x06\n" +
|
||||
"\x04User\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" +
|
||||
"\busername\x18\x02 \x01(\tH\x00R\busername\x88\x01\x01\x12\x19\n" +
|
||||
"\x05email\x18\x03 \x01(\tH\x01R\x05email\x88\x01\x01\x12\x19\n" +
|
||||
"\x05phone\x18\x04 \x01(\tH\x02R\x05phone\x88\x01\x01\x12 \n" +
|
||||
"\tfull_name\x18\x05 \x01(\tH\x03R\bfullName\x88\x01\x01\x12\x17\n" +
|
||||
"\ais_ldap\x18\x06 \x01(\bR\x06isLdap\x12\x1b\n" +
|
||||
"\x06status\x18\a \x01(\tH\x04R\x06status\x88\x01\x01\x12\x14\n" +
|
||||
"\x05roles\x18\b \x03(\tR\x05roles\x12\"\n" +
|
||||
"\n" +
|
||||
"avatar_url\x18\t \x01(\tH\x05R\tavatarUrl\x88\x01\x01\x12$\n" +
|
||||
"\vemployee_id\x18\n" +
|
||||
" \x01(\tH\x06R\n" +
|
||||
"employeeId\x88\x01\x01\x12\x1f\n" +
|
||||
"\bpresence\x18\v \x01(\tH\aR\bpresence\x88\x01\x01\x12$\n" +
|
||||
"\vlast_active\x18\f \x01(\tH\bR\n" +
|
||||
"lastActive\x88\x01\x01\x121\n" +
|
||||
"\x12custom_status_text\x18\r \x01(\tH\tR\x10customStatusText\x88\x01\x01\x123\n" +
|
||||
"\x13custom_status_emoji\x18\x0e \x01(\tH\n" +
|
||||
"R\x11customStatusEmoji\x88\x01\x01\x12\x1f\n" +
|
||||
"\btimezone\x18\x0f \x01(\tH\vR\btimezone\x88\x01\x01\x12\x1f\n" +
|
||||
"\blanguage\x18\x10 \x01(\tH\fR\blanguage\x88\x01\x01\x12$\n" +
|
||||
"\x0etwo_fa_enabled\x18\x11 \x01(\bR\ftwoFaEnabled\x12\x17\n" +
|
||||
"\ahas_pin\x18\x12 \x01(\bR\x06hasPinB\v\n" +
|
||||
"\t_usernameB\b\n" +
|
||||
"\x06_emailB\b\n" +
|
||||
"\x06_phoneB\f\n" +
|
||||
"\n" +
|
||||
"_full_nameB\t\n" +
|
||||
"\a_statusB\r\n" +
|
||||
"\v_avatar_urlB\x0e\n" +
|
||||
"\f_employee_idB\v\n" +
|
||||
"\t_presenceB\x0e\n" +
|
||||
"\f_last_activeB\x15\n" +
|
||||
"\x13_custom_status_textB\x16\n" +
|
||||
"\x14_custom_status_emojiB\v\n" +
|
||||
"\t_timezoneB\v\n" +
|
||||
"\t_language2\xd4\x01\n" +
|
||||
"\fUsersService\x128\n" +
|
||||
"\x05GetMe\x12\x16.users.v1.GetMeRequest\x1a\x17.users.v1.GetMeResponse\x12A\n" +
|
||||
"\bChangeMe\x12\x19.users.v1.ChangeMeRequest\x1a\x1a.users.v1.ChangeMeResponse\x12G\n" +
|
||||
"\n" +
|
||||
"CreateUser\x12\x1b.users.v1.CreateUserRequest\x1a\x1c.users.v1.CreateUserResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||
|
||||
var (
|
||||
file_users_users_proto_rawDescOnce sync.Once
|
||||
file_users_users_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_users_users_proto_rawDescGZIP() []byte {
|
||||
file_users_users_proto_rawDescOnce.Do(func() {
|
||||
file_users_users_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_users_users_proto_rawDesc), len(file_users_users_proto_rawDesc)))
|
||||
})
|
||||
return file_users_users_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_users_users_proto_goTypes = []any{
|
||||
(*GetMeRequest)(nil), // 0: users.v1.GetMeRequest
|
||||
(*GetMeResponse)(nil), // 1: users.v1.GetMeResponse
|
||||
(*CreateUserRequest)(nil), // 2: users.v1.CreateUserRequest
|
||||
(*CreateUserResponse)(nil), // 3: users.v1.CreateUserResponse
|
||||
(*ChangeMeRequest)(nil), // 4: users.v1.ChangeMeRequest
|
||||
(*ChangeMeResponse)(nil), // 5: users.v1.ChangeMeResponse
|
||||
(*User)(nil), // 6: users.v1.User
|
||||
}
|
||||
var file_users_users_proto_depIdxs = []int32{
|
||||
6, // 0: users.v1.GetMeResponse.user:type_name -> users.v1.User
|
||||
0, // 1: users.v1.UsersService.GetMe:input_type -> users.v1.GetMeRequest
|
||||
4, // 2: users.v1.UsersService.ChangeMe:input_type -> users.v1.ChangeMeRequest
|
||||
2, // 3: users.v1.UsersService.CreateUser:input_type -> users.v1.CreateUserRequest
|
||||
1, // 4: users.v1.UsersService.GetMe:output_type -> users.v1.GetMeResponse
|
||||
5, // 5: users.v1.UsersService.ChangeMe:output_type -> users.v1.ChangeMeResponse
|
||||
3, // 6: users.v1.UsersService.CreateUser:output_type -> users.v1.CreateUserResponse
|
||||
4, // [4:7] is the sub-list for method output_type
|
||||
1, // [1:4] 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_users_users_proto_init() }
|
||||
func file_users_users_proto_init() {
|
||||
if File_users_users_proto != nil {
|
||||
return
|
||||
}
|
||||
file_users_users_proto_msgTypes[4].OneofWrappers = []any{}
|
||||
file_users_users_proto_msgTypes[6].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_users_proto_rawDesc), len(file_users_users_proto_rawDesc)),
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_users_users_proto_goTypes,
|
||||
DependencyIndexes: file_users_users_proto_depIdxs,
|
||||
MessageInfos: file_users_users_proto_msgTypes,
|
||||
}.Build()
|
||||
File_users_users_proto = out.File
|
||||
file_users_users_proto_goTypes = nil
|
||||
file_users_users_proto_depIdxs = nil
|
||||
}
|
||||
197
gen/go/users/users_grpc.pb.go
Normal file
197
gen/go/users/users_grpc.pb.go
Normal file
@@ -0,0 +1,197 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v4.25.9
|
||||
// source: users/users.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 (
|
||||
UsersService_GetMe_FullMethodName = "/users.v1.UsersService/GetMe"
|
||||
UsersService_ChangeMe_FullMethodName = "/users.v1.UsersService/ChangeMe"
|
||||
UsersService_CreateUser_FullMethodName = "/users.v1.UsersService/CreateUser"
|
||||
)
|
||||
|
||||
// UsersServiceClient is the client API for UsersService 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 UsersServiceClient interface {
|
||||
GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error)
|
||||
ChangeMe(ctx context.Context, in *ChangeMeRequest, opts ...grpc.CallOption) (*ChangeMeResponse, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
|
||||
}
|
||||
|
||||
type usersServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUsersServiceClient(cc grpc.ClientConnInterface) UsersServiceClient {
|
||||
return &usersServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *usersServiceClient) GetMe(ctx context.Context, in *GetMeRequest, opts ...grpc.CallOption) (*GetMeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetMeResponse)
|
||||
err := c.cc.Invoke(ctx, UsersService_GetMe_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *usersServiceClient) ChangeMe(ctx context.Context, in *ChangeMeRequest, opts ...grpc.CallOption) (*ChangeMeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ChangeMeResponse)
|
||||
err := c.cc.Invoke(ctx, UsersService_ChangeMe_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *usersServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateUserResponse)
|
||||
err := c.cc.Invoke(ctx, UsersService_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// UsersServiceServer is the server API for UsersService service.
|
||||
// All implementations must embed UnimplementedUsersServiceServer
|
||||
// for forward compatibility.
|
||||
type UsersServiceServer interface {
|
||||
GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error)
|
||||
ChangeMe(context.Context, *ChangeMeRequest) (*ChangeMeResponse, error)
|
||||
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
|
||||
mustEmbedUnimplementedUsersServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedUsersServiceServer 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 UnimplementedUsersServiceServer struct{}
|
||||
|
||||
func (UnimplementedUsersServiceServer) GetMe(context.Context, *GetMeRequest) (*GetMeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetMe not implemented")
|
||||
}
|
||||
func (UnimplementedUsersServiceServer) ChangeMe(context.Context, *ChangeMeRequest) (*ChangeMeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangeMe not implemented")
|
||||
}
|
||||
func (UnimplementedUsersServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
|
||||
func (UnimplementedUsersServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeUsersServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UsersServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUsersServiceServer interface {
|
||||
mustEmbedUnimplementedUsersServiceServer()
|
||||
}
|
||||
|
||||
func RegisterUsersServiceServer(s grpc.ServiceRegistrar, srv UsersServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedUsersServiceServer 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(&UsersService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UsersService_GetMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetMeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UsersServiceServer).GetMe(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UsersService_GetMe_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UsersServiceServer).GetMe(ctx, req.(*GetMeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UsersService_ChangeMe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangeMeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UsersServiceServer).ChangeMe(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UsersService_ChangeMe_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UsersServiceServer).ChangeMe(ctx, req.(*ChangeMeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UsersService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UsersServiceServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: UsersService_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UsersServiceServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UsersService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "users.v1.UsersService",
|
||||
HandlerType: (*UsersServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetMe",
|
||||
Handler: _UsersService_GetMe_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangeMe",
|
||||
Handler: _UsersService_ChangeMe_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _UsersService_CreateUser_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "users/users.proto",
|
||||
}
|
||||
@@ -49,76 +49,6 @@ export interface ChangePasswordResponse {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CreateUserRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface CreateUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DeleteUserRequest {
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface DeleteUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ChangeDataRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
fullName?: string | undefined;
|
||||
avatarUrl?: string | undefined;
|
||||
customStatusText?: string | undefined;
|
||||
customStatusEmoji?: string | undefined;
|
||||
timezone?: string | undefined;
|
||||
language?: string | undefined;
|
||||
isPublic?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface ChangeDataResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface AssignRoleRequest {
|
||||
userId: string;
|
||||
/** В gRPC передаем как string, внутри преобразуем в Int */
|
||||
roleId: string;
|
||||
}
|
||||
|
||||
export interface AssignRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RevokeRoleRequest {
|
||||
userId: string;
|
||||
roleId: string;
|
||||
}
|
||||
|
||||
export interface RevokeRoleResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface AdminResetPasswordRequest {
|
||||
userId: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface AdminResetPasswordResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface SetPinRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
@@ -163,59 +93,6 @@ export interface RemovePinResponse {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface BlockUserRequest {
|
||||
/** Кого блокируем */
|
||||
userId: string;
|
||||
/** Кто блокирует */
|
||||
adminId: string;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BlockUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface UnblockUserRequest {
|
||||
userId: string;
|
||||
adminId: string;
|
||||
}
|
||||
|
||||
export interface UnblockUserResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface BlockIpRequest {
|
||||
ipAddress: string;
|
||||
adminId: string;
|
||||
reason?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BlockIpResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface UnblockIpRequest {
|
||||
ipAddress: string;
|
||||
adminId: string;
|
||||
}
|
||||
|
||||
export interface UnblockIpResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/** Можно оставить пустым, так как нам не нужны входные данные */
|
||||
export interface SyncUsersToSearchRequest {
|
||||
}
|
||||
|
||||
export interface SyncUsersToSearchResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
||||
|
||||
export interface AccountServiceClient {
|
||||
@@ -223,18 +100,6 @@ export interface AccountServiceClient {
|
||||
|
||||
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<ChangePasswordResponse>;
|
||||
|
||||
adminResetPassword(request: AdminResetPasswordRequest, metadata?: Metadata): Observable<AdminResetPasswordResponse>;
|
||||
|
||||
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>;
|
||||
|
||||
deleteUser(request: DeleteUserRequest, metadata?: Metadata): Observable<DeleteUserResponse>;
|
||||
|
||||
changeData(request: ChangeDataRequest, metadata?: Metadata): Observable<ChangeDataResponse>;
|
||||
|
||||
assignRole(request: AssignRoleRequest, metadata?: Metadata): Observable<AssignRoleResponse>;
|
||||
|
||||
revokeRole(request: RevokeRoleRequest, metadata?: Metadata): Observable<RevokeRoleResponse>;
|
||||
|
||||
setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>;
|
||||
|
||||
unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>;
|
||||
@@ -242,16 +107,6 @@ export interface AccountServiceClient {
|
||||
getPinStatus(request: GetPinStatusRequest, metadata?: Metadata): Observable<GetPinStatusResponse>;
|
||||
|
||||
removePin(request: RemovePinRequest, metadata?: Metadata): Observable<RemovePinResponse>;
|
||||
|
||||
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<BlockUserResponse>;
|
||||
|
||||
unblockUser(request: UnblockUserRequest, metadata?: Metadata): Observable<UnblockUserResponse>;
|
||||
|
||||
blockIp(request: BlockIpRequest, metadata?: Metadata): Observable<BlockIpResponse>;
|
||||
|
||||
unblockIp(request: UnblockIpRequest, metadata?: Metadata): Observable<UnblockIpResponse>;
|
||||
|
||||
syncUsersToSearch(request: SyncUsersToSearchRequest, metadata?: Metadata): Observable<SyncUsersToSearchResponse>;
|
||||
}
|
||||
|
||||
export interface AccountServiceController {
|
||||
@@ -265,36 +120,6 @@ export interface AccountServiceController {
|
||||
metadata?: Metadata,
|
||||
): Promise<ChangePasswordResponse> | Observable<ChangePasswordResponse> | ChangePasswordResponse;
|
||||
|
||||
adminResetPassword(
|
||||
request: AdminResetPasswordRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<AdminResetPasswordResponse> | Observable<AdminResetPasswordResponse> | AdminResetPasswordResponse;
|
||||
|
||||
createUser(
|
||||
request: CreateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
||||
|
||||
deleteUser(
|
||||
request: DeleteUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
|
||||
|
||||
changeData(
|
||||
request: ChangeDataRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ChangeDataResponse> | Observable<ChangeDataResponse> | ChangeDataResponse;
|
||||
|
||||
assignRole(
|
||||
request: AssignRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<AssignRoleResponse> | Observable<AssignRoleResponse> | AssignRoleResponse;
|
||||
|
||||
revokeRole(
|
||||
request: RevokeRoleRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<RevokeRoleResponse> | Observable<RevokeRoleResponse> | RevokeRoleResponse;
|
||||
|
||||
setPin(
|
||||
request: SetPinRequest,
|
||||
metadata?: Metadata,
|
||||
@@ -314,54 +139,11 @@ export interface AccountServiceController {
|
||||
request: RemovePinRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<RemovePinResponse> | Observable<RemovePinResponse> | RemovePinResponse;
|
||||
|
||||
blockUser(
|
||||
request: BlockUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
|
||||
|
||||
unblockUser(
|
||||
request: UnblockUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<UnblockUserResponse> | Observable<UnblockUserResponse> | UnblockUserResponse;
|
||||
|
||||
blockIp(
|
||||
request: BlockIpRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<BlockIpResponse> | Observable<BlockIpResponse> | BlockIpResponse;
|
||||
|
||||
unblockIp(
|
||||
request: UnblockIpRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<UnblockIpResponse> | Observable<UnblockIpResponse> | UnblockIpResponse;
|
||||
|
||||
syncUsersToSearch(
|
||||
request: SyncUsersToSearchRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<SyncUsersToSearchResponse> | Observable<SyncUsersToSearchResponse> | SyncUsersToSearchResponse;
|
||||
}
|
||||
|
||||
export function AccountServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = [
|
||||
"getAccount",
|
||||
"changePassword",
|
||||
"adminResetPassword",
|
||||
"createUser",
|
||||
"deleteUser",
|
||||
"changeData",
|
||||
"assignRole",
|
||||
"revokeRole",
|
||||
"setPin",
|
||||
"unlockPin",
|
||||
"getPinStatus",
|
||||
"removePin",
|
||||
"blockUser",
|
||||
"unblockUser",
|
||||
"blockIp",
|
||||
"unblockIp",
|
||||
"syncUsersToSearch",
|
||||
];
|
||||
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);
|
||||
|
||||
211
gen/users/ldap.ts
Normal file
211
gen/users/ldap.ts
Normal file
@@ -0,0 +1,211 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: users/ldap.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "ldap.v1";
|
||||
|
||||
/**
|
||||
* ==========================================
|
||||
* БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ
|
||||
* ==========================================
|
||||
*/
|
||||
export interface EmptyRequest {
|
||||
}
|
||||
|
||||
/** Стандартный ответ для мутаций (создание, обновление, удаление) */
|
||||
export interface StatusResponse {
|
||||
success: boolean;
|
||||
errorMessage: string;
|
||||
}
|
||||
|
||||
/** Полная модель пользователя */
|
||||
export interface UserData {
|
||||
/** Полный путь в AD (Distinguished Name) */
|
||||
dn: string;
|
||||
/** Логин (sAMAccountName) */
|
||||
username: string;
|
||||
/** ФИО (displayName) */
|
||||
displayName: string;
|
||||
/** Почта (mail) */
|
||||
email: string;
|
||||
/** Описание/Должность (description) */
|
||||
description: string;
|
||||
/** Аватарка в байтах (thumbnailPhoto) */
|
||||
avatar: Uint8Array;
|
||||
/** Список групп */
|
||||
groups: string[];
|
||||
/** Статус аккаунта */
|
||||
isActive: boolean;
|
||||
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;
|
||||
/** Сразу при создании можно задать почту */
|
||||
email?: string | undefined;
|
||||
}
|
||||
|
||||
/** Запрос на обновление. Используем optional для частичного обновления. */
|
||||
export interface UpdateUserRequest {
|
||||
/** Обязательное поле: кого обновляем */
|
||||
username: string;
|
||||
/** Новое ФИО (повлечет Rename CN) */
|
||||
displayName?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новая почта */
|
||||
email?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новое описание */
|
||||
description?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новая аватарка (бинарник картинки) */
|
||||
avatar?: Uint8Array | undefined;
|
||||
}
|
||||
|
||||
export interface ChangePasswordRequest {
|
||||
username: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface ToggleStatusRequest {
|
||||
username: string;
|
||||
/** true - включить (512), false - отключить (514) */
|
||||
setActive: boolean;
|
||||
}
|
||||
|
||||
/** --- Управление членством в группах --- */
|
||||
export interface GroupMemberRequest {
|
||||
/** Логин пользователя */
|
||||
username: string;
|
||||
/** Полный путь группы (в которую добавляем / из которой удаляем) */
|
||||
groupDn: string;
|
||||
}
|
||||
|
||||
export const LDAP_V1_PACKAGE_NAME = "ldap.v1";
|
||||
|
||||
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) {
|
||||
const grpcMethods: string[] = [
|
||||
"getUsers",
|
||||
"createUser",
|
||||
"updateUser",
|
||||
"changePassword",
|
||||
"toggleUserStatus",
|
||||
"getGroups",
|
||||
"addUserToGroup",
|
||||
"removeUserFromGroup",
|
||||
];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("LdapService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("LdapService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const LDAP_SERVICE_NAME = "LdapService";
|
||||
109
gen/users/users.ts
Normal file
109
gen/users/users.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: users/users.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "users.v1";
|
||||
|
||||
export interface GetMeRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface GetMeResponse {
|
||||
user: User | undefined;
|
||||
}
|
||||
|
||||
export interface CreateUserRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CreateUserResponse {
|
||||
success: string;
|
||||
}
|
||||
|
||||
export interface ChangeMeRequest {
|
||||
userId: string;
|
||||
sessionId: string;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
fullName?: string | undefined;
|
||||
avatarUrl?: string | undefined;
|
||||
customStatusText?: string | undefined;
|
||||
customStatusEmoji?: string | undefined;
|
||||
timezone?: string | undefined;
|
||||
language?: string | undefined;
|
||||
isPublic?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface ChangeMeResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
username?: string | undefined;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
fullName?: string | undefined;
|
||||
isLdap: boolean;
|
||||
status?: string | undefined;
|
||||
roles: string[];
|
||||
avatarUrl?: string | undefined;
|
||||
employeeId?: string | undefined;
|
||||
presence?: string | undefined;
|
||||
lastActive?: string | undefined;
|
||||
customStatusText?: string | undefined;
|
||||
customStatusEmoji?: string | undefined;
|
||||
timezone?: string | undefined;
|
||||
language?: string | undefined;
|
||||
twoFaEnabled: boolean;
|
||||
hasPin: boolean;
|
||||
}
|
||||
|
||||
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
||||
|
||||
export interface UsersServiceClient {
|
||||
getMe(request: GetMeRequest, metadata?: Metadata): Observable<GetMeResponse>;
|
||||
|
||||
changeMe(request: ChangeMeRequest, metadata?: Metadata): Observable<ChangeMeResponse>;
|
||||
|
||||
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>;
|
||||
}
|
||||
|
||||
export interface UsersServiceController {
|
||||
getMe(request: GetMeRequest, metadata?: Metadata): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
||||
|
||||
changeMe(
|
||||
request: ChangeMeRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ChangeMeResponse> | Observable<ChangeMeResponse> | ChangeMeResponse;
|
||||
|
||||
createUser(
|
||||
request: CreateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
||||
}
|
||||
|
||||
export function UsersServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = ["getMe", "changeMe", "createUser"];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const USERS_SERVICE_NAME = "UsersService";
|
||||
Reference in New Issue
Block a user