From 4592be93bb03f2ed727bb2e0753b703c608fd6e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Apr 2026 19:50:57 +0000 Subject: [PATCH] chore: auto-generate protobuf files [skip ci] --- gen/admin/admin-account.ts | 151 ++++ gen/go/admin/admin-account.pb.go | 1005 +++++++++++++++++++++++-- gen/go/admin/admin-account_grpc.pb.go | 268 +++++++ 3 files changed, 1371 insertions(+), 53 deletions(-) diff --git a/gen/admin/admin-account.ts b/gen/admin/admin-account.ts index 02a819b..526f938 100644 --- a/gen/admin/admin-account.ts +++ b/gen/admin/admin-account.ts @@ -134,6 +134,85 @@ export interface SyncUsersToSearchResponse { message: string; } +export interface GetAllPermissionsAdminRequest { + userId: string; + sessionId: string; +} + +export interface PermissionAdmin { + id: string; + code: string; + description: string; + module: string; + roles: string[]; +} + +export interface GetAllPermissionsAdminResponse { + permissions: PermissionAdmin[]; +} + +export interface GetAllRolesAdminRequest { + userId: string; + sessionId: string; +} + +export interface RolesAdmin { + id: string; + name: string; + level: number; + permissions: string[]; + ldapMapping: string[]; + accounts: string[]; +} + +export interface GetAllRolesAdminResponse { + roles: RolesAdmin[]; +} + +export interface CreateRoleAdminRequest { + name: string; + level: number; + permissionCodes: string[]; +} + +export interface UpdateRoleAdminRequest { + id: string; + name?: string | undefined; + level?: number | undefined; + permissionCodes: string[]; +} + +export interface ModifyRoleAdminResponse { + success: boolean; + message: string; +} + +export interface DeleteRoleAdminRequest { + id: string; +} + +export interface DeleteRoleAdminResponse { + success: boolean; + message: string; + fallbackRoleName?: string | undefined; +} + +export interface CreatePermissionAdminRequest { + code: string; + description: string; + module: string; +} + +export interface UpdatePermissionAdminRequest { + id: string; + roleIds: string[]; +} + +export interface ModifyPermissionAdminResponse { + success: boolean; + message: string; +} + export const ADMIN_V1_PACKAGE_NAME = "admin.v1"; /** Единый сервис для всех административных операций */ @@ -170,6 +249,31 @@ export interface AdminServiceClient { /** Синхронизация с поисковым движком (Elasticsearch) */ syncUsersToSearch(request: SyncUsersToSearchRequest, metadata?: Metadata): Observable; + + /** RBAC */ + + getAllPermissions( + request: GetAllPermissionsAdminRequest, + metadata?: Metadata, + ): Observable; + + getAllRoles(request: GetAllRolesAdminRequest, metadata?: Metadata): Observable; + + createRole(request: CreateRoleAdminRequest, metadata?: Metadata): Observable; + + updateRole(request: UpdateRoleAdminRequest, metadata?: Metadata): Observable; + + deleteRole(request: DeleteRoleAdminRequest, metadata?: Metadata): Observable; + + createPermission( + request: CreatePermissionAdminRequest, + metadata?: Metadata, + ): Observable; + + updatePermission( + request: UpdatePermissionAdminRequest, + metadata?: Metadata, + ): Observable; } /** Единый сервис для всех административных операций */ @@ -239,6 +343,46 @@ export interface AdminServiceController { request: SyncUsersToSearchRequest, metadata?: Metadata, ): Promise | Observable | SyncUsersToSearchResponse; + + /** RBAC */ + + getAllPermissions( + request: GetAllPermissionsAdminRequest, + metadata?: Metadata, + ): + | Promise + | Observable + | GetAllPermissionsAdminResponse; + + getAllRoles( + request: GetAllRolesAdminRequest, + metadata?: Metadata, + ): Promise | Observable | GetAllRolesAdminResponse; + + createRole( + request: CreateRoleAdminRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyRoleAdminResponse; + + updateRole( + request: UpdateRoleAdminRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyRoleAdminResponse; + + deleteRole( + request: DeleteRoleAdminRequest, + metadata?: Metadata, + ): Promise | Observable | DeleteRoleAdminResponse; + + createPermission( + request: CreatePermissionAdminRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyPermissionAdminResponse; + + updatePermission( + request: UpdatePermissionAdminRequest, + metadata?: Metadata, + ): Promise | Observable | ModifyPermissionAdminResponse; } export function AdminServiceControllerMethods() { @@ -255,6 +399,13 @@ export function AdminServiceControllerMethods() { "blockIp", "unblockIp", "syncUsersToSearch", + "getAllPermissions", + "getAllRoles", + "createRole", + "updateRole", + "deleteRole", + "createPermission", + "updatePermission", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/gen/go/admin/admin-account.pb.go b/gen/go/admin/admin-account.pb.go index 441c460..8a56ca9 100644 --- a/gen/go/admin/admin-account.pb.go +++ b/gen/go/admin/admin-account.pb.go @@ -1237,6 +1237,806 @@ func (x *SyncUsersToSearchResponse) GetMessage() string { return "" } +type GetAllPermissionsAdminRequest 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 *GetAllPermissionsAdminRequest) Reset() { + *x = GetAllPermissionsAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllPermissionsAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllPermissionsAdminRequest) ProtoMessage() {} + +func (x *GetAllPermissionsAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[22] + 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 GetAllPermissionsAdminRequest.ProtoReflect.Descriptor instead. +func (*GetAllPermissionsAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{22} +} + +func (x *GetAllPermissionsAdminRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetAllPermissionsAdminRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type PermissionAdmin 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 *PermissionAdmin) Reset() { + *x = PermissionAdmin{} + mi := &file_admin_admin_account_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PermissionAdmin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionAdmin) ProtoMessage() {} + +func (x *PermissionAdmin) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[23] + 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 PermissionAdmin.ProtoReflect.Descriptor instead. +func (*PermissionAdmin) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{23} +} + +func (x *PermissionAdmin) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PermissionAdmin) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *PermissionAdmin) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *PermissionAdmin) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +func (x *PermissionAdmin) GetRoles() []string { + if x != nil { + return x.Roles + } + return nil +} + +type GetAllPermissionsAdminResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Permissions []*PermissionAdmin `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllPermissionsAdminResponse) Reset() { + *x = GetAllPermissionsAdminResponse{} + mi := &file_admin_admin_account_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllPermissionsAdminResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllPermissionsAdminResponse) ProtoMessage() {} + +func (x *GetAllPermissionsAdminResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[24] + 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 GetAllPermissionsAdminResponse.ProtoReflect.Descriptor instead. +func (*GetAllPermissionsAdminResponse) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{24} +} + +func (x *GetAllPermissionsAdminResponse) GetPermissions() []*PermissionAdmin { + if x != nil { + return x.Permissions + } + return nil +} + +type GetAllRolesAdminRequest 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 *GetAllRolesAdminRequest) Reset() { + *x = GetAllRolesAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllRolesAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllRolesAdminRequest) ProtoMessage() {} + +func (x *GetAllRolesAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[25] + 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 GetAllRolesAdminRequest.ProtoReflect.Descriptor instead. +func (*GetAllRolesAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{25} +} + +func (x *GetAllRolesAdminRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetAllRolesAdminRequest) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +type RolesAdmin 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 *RolesAdmin) Reset() { + *x = RolesAdmin{} + mi := &file_admin_admin_account_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RolesAdmin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RolesAdmin) ProtoMessage() {} + +func (x *RolesAdmin) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[26] + 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 RolesAdmin.ProtoReflect.Descriptor instead. +func (*RolesAdmin) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{26} +} + +func (x *RolesAdmin) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RolesAdmin) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RolesAdmin) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *RolesAdmin) GetPermissions() []string { + if x != nil { + return x.Permissions + } + return nil +} + +func (x *RolesAdmin) GetLdapMapping() []string { + if x != nil { + return x.LdapMapping + } + return nil +} + +func (x *RolesAdmin) GetAccounts() []string { + if x != nil { + return x.Accounts + } + return nil +} + +type GetAllRolesAdminResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Roles []*RolesAdmin `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAllRolesAdminResponse) Reset() { + *x = GetAllRolesAdminResponse{} + mi := &file_admin_admin_account_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAllRolesAdminResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllRolesAdminResponse) ProtoMessage() {} + +func (x *GetAllRolesAdminResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[27] + 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 GetAllRolesAdminResponse.ProtoReflect.Descriptor instead. +func (*GetAllRolesAdminResponse) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{27} +} + +func (x *GetAllRolesAdminResponse) GetRoles() []*RolesAdmin { + if x != nil { + return x.Roles + } + return nil +} + +type CreateRoleAdminRequest 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 *CreateRoleAdminRequest) Reset() { + *x = CreateRoleAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRoleAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRoleAdminRequest) ProtoMessage() {} + +func (x *CreateRoleAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[28] + 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 CreateRoleAdminRequest.ProtoReflect.Descriptor instead. +func (*CreateRoleAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{28} +} + +func (x *CreateRoleAdminRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateRoleAdminRequest) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *CreateRoleAdminRequest) GetPermissionCodes() []string { + if x != nil { + return x.PermissionCodes + } + return nil +} + +type UpdateRoleAdminRequest 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 *UpdateRoleAdminRequest) Reset() { + *x = UpdateRoleAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateRoleAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRoleAdminRequest) ProtoMessage() {} + +func (x *UpdateRoleAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[29] + 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 UpdateRoleAdminRequest.ProtoReflect.Descriptor instead. +func (*UpdateRoleAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{29} +} + +func (x *UpdateRoleAdminRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateRoleAdminRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *UpdateRoleAdminRequest) GetLevel() int32 { + if x != nil && x.Level != nil { + return *x.Level + } + return 0 +} + +func (x *UpdateRoleAdminRequest) GetPermissionCodes() []string { + if x != nil { + return x.PermissionCodes + } + return nil +} + +type ModifyRoleAdminResponse 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 *ModifyRoleAdminResponse) Reset() { + *x = ModifyRoleAdminResponse{} + mi := &file_admin_admin_account_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ModifyRoleAdminResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyRoleAdminResponse) ProtoMessage() {} + +func (x *ModifyRoleAdminResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[30] + 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 ModifyRoleAdminResponse.ProtoReflect.Descriptor instead. +func (*ModifyRoleAdminResponse) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{30} +} + +func (x *ModifyRoleAdminResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ModifyRoleAdminResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeleteRoleAdminRequest 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 *DeleteRoleAdminRequest) Reset() { + *x = DeleteRoleAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRoleAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRoleAdminRequest) ProtoMessage() {} + +func (x *DeleteRoleAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[31] + 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 DeleteRoleAdminRequest.ProtoReflect.Descriptor instead. +func (*DeleteRoleAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{31} +} + +func (x *DeleteRoleAdminRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteRoleAdminResponse 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 *DeleteRoleAdminResponse) Reset() { + *x = DeleteRoleAdminResponse{} + mi := &file_admin_admin_account_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRoleAdminResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRoleAdminResponse) ProtoMessage() {} + +func (x *DeleteRoleAdminResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[32] + 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 DeleteRoleAdminResponse.ProtoReflect.Descriptor instead. +func (*DeleteRoleAdminResponse) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{32} +} + +func (x *DeleteRoleAdminResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *DeleteRoleAdminResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *DeleteRoleAdminResponse) GetFallbackRoleName() string { + if x != nil && x.FallbackRoleName != nil { + return *x.FallbackRoleName + } + return "" +} + +type CreatePermissionAdminRequest 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 *CreatePermissionAdminRequest) Reset() { + *x = CreatePermissionAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreatePermissionAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePermissionAdminRequest) ProtoMessage() {} + +func (x *CreatePermissionAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[33] + 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 CreatePermissionAdminRequest.ProtoReflect.Descriptor instead. +func (*CreatePermissionAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{33} +} + +func (x *CreatePermissionAdminRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *CreatePermissionAdminRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreatePermissionAdminRequest) GetModule() string { + if x != nil { + return x.Module + } + return "" +} + +type UpdatePermissionAdminRequest 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 *UpdatePermissionAdminRequest) Reset() { + *x = UpdatePermissionAdminRequest{} + mi := &file_admin_admin_account_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdatePermissionAdminRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePermissionAdminRequest) ProtoMessage() {} + +func (x *UpdatePermissionAdminRequest) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[34] + 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 UpdatePermissionAdminRequest.ProtoReflect.Descriptor instead. +func (*UpdatePermissionAdminRequest) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{34} +} + +func (x *UpdatePermissionAdminRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdatePermissionAdminRequest) GetRoleIds() []string { + if x != nil { + return x.RoleIds + } + return nil +} + +type ModifyPermissionAdminResponse 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 *ModifyPermissionAdminResponse) Reset() { + *x = ModifyPermissionAdminResponse{} + mi := &file_admin_admin_account_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ModifyPermissionAdminResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModifyPermissionAdminResponse) ProtoMessage() {} + +func (x *ModifyPermissionAdminResponse) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_account_proto_msgTypes[35] + 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 ModifyPermissionAdminResponse.ProtoReflect.Descriptor instead. +func (*ModifyPermissionAdminResponse) Descriptor() ([]byte, []int) { + return file_admin_admin_account_proto_rawDescGZIP(), []int{35} +} + +func (x *ModifyPermissionAdminResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *ModifyPermissionAdminResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + var File_admin_admin_account_proto protoreflect.FileDescriptor const file_admin_admin_account_proto_rawDesc = "" + @@ -1334,7 +2134,64 @@ const file_admin_admin_account_proto_rawDesc = "" + "\x18SyncUsersToSearchRequest\"O\n" + "\x19SyncUsersToSearchResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage2\xd2\x06\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"W\n" + + "\x1dGetAllPermissionsAdminRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"\x85\x01\n" + + "\x0fPermissionAdmin\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\"]\n" + + "\x1eGetAllPermissionsAdminResponse\x12;\n" + + "\vpermissions\x18\x01 \x03(\v2\x19.admin.v1.PermissionAdminR\vpermissions\"Q\n" + + "\x17GetAllRolesAdminRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1d\n" + + "\n" + + "session_id\x18\x02 \x01(\tR\tsessionId\"\xa7\x01\n" + + "\n" + + "RolesAdmin\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\baccounts\"F\n" + + "\x18GetAllRolesAdminResponse\x12*\n" + + "\x05roles\x18\x01 \x03(\v2\x14.admin.v1.RolesAdminR\x05roles\"m\n" + + "\x16CreateRoleAdminRequest\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\"\x9a\x01\n" + + "\x16UpdateRoleAdminRequest\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\"M\n" + + "\x17ModifyRoleAdminResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"(\n" + + "\x16DeleteRoleAdminRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x97\x01\n" + + "\x17DeleteRoleAdminResponse\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\"l\n" + + "\x1cCreatePermissionAdminRequest\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\"I\n" + + "\x1cUpdatePermissionAdminRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" + + "\brole_ids\x18\x02 \x03(\tR\aroleIds\"S\n" + + "\x1dModifyPermissionAdminResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage2\xd3\v\n" + "\fAdminService\x12G\n" + "\n" + "CreateUser\x12\x1b.admin.v1.CreateUserRequest\x1a\x1c.admin.v1.CreateUserResponse\x12G\n" + @@ -1351,7 +2208,17 @@ const file_admin_admin_account_proto_rawDesc = "" + "RevokeRole\x12\x1b.admin.v1.RevokeRoleRequest\x1a\x1c.admin.v1.RevokeRoleResponse\x12>\n" + "\aBlockIp\x12\x18.admin.v1.BlockIpRequest\x1a\x19.admin.v1.BlockIpResponse\x12D\n" + "\tUnblockIp\x12\x1a.admin.v1.UnblockIpRequest\x1a\x1b.admin.v1.UnblockIpResponse\x12\\\n" + - "\x11SyncUsersToSearch\x12\".admin.v1.SyncUsersToSearchRequest\x1a#.admin.v1.SyncUsersToSearchResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + "\x11SyncUsersToSearch\x12\".admin.v1.SyncUsersToSearchRequest\x1a#.admin.v1.SyncUsersToSearchResponse\x12f\n" + + "\x11GetAllPermissions\x12'.admin.v1.GetAllPermissionsAdminRequest\x1a(.admin.v1.GetAllPermissionsAdminResponse\x12T\n" + + "\vGetAllRoles\x12!.admin.v1.GetAllRolesAdminRequest\x1a\".admin.v1.GetAllRolesAdminResponse\x12Q\n" + + "\n" + + "CreateRole\x12 .admin.v1.CreateRoleAdminRequest\x1a!.admin.v1.ModifyRoleAdminResponse\x12Q\n" + + "\n" + + "UpdateRole\x12 .admin.v1.UpdateRoleAdminRequest\x1a!.admin.v1.ModifyRoleAdminResponse\x12Q\n" + + "\n" + + "DeleteRole\x12 .admin.v1.DeleteRoleAdminRequest\x1a!.admin.v1.DeleteRoleAdminResponse\x12c\n" + + "\x10CreatePermission\x12&.admin.v1.CreatePermissionAdminRequest\x1a'.admin.v1.ModifyPermissionAdminResponse\x12c\n" + + "\x10UpdatePermission\x12&.admin.v1.UpdatePermissionAdminRequest\x1a'.admin.v1.ModifyPermissionAdminResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" var ( file_admin_admin_account_proto_rawDescOnce sync.Once @@ -1365,59 +2232,89 @@ func file_admin_admin_account_proto_rawDescGZIP() []byte { return file_admin_admin_account_proto_rawDescData } -var file_admin_admin_account_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_admin_admin_account_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_admin_admin_account_proto_goTypes = []any{ - (*CreateUserRequest)(nil), // 0: admin.v1.CreateUserRequest - (*CreateUserResponse)(nil), // 1: admin.v1.CreateUserResponse - (*DeleteUserRequest)(nil), // 2: admin.v1.DeleteUserRequest - (*DeleteUserResponse)(nil), // 3: admin.v1.DeleteUserResponse - (*BlockUserRequest)(nil), // 4: admin.v1.BlockUserRequest - (*BlockUserResponse)(nil), // 5: admin.v1.BlockUserResponse - (*UnblockUserRequest)(nil), // 6: admin.v1.UnblockUserRequest - (*UnblockUserResponse)(nil), // 7: admin.v1.UnblockUserResponse - (*ChangeDataRequest)(nil), // 8: admin.v1.ChangeDataRequest - (*ChangeDataResponse)(nil), // 9: admin.v1.ChangeDataResponse - (*AdminResetPasswordRequest)(nil), // 10: admin.v1.AdminResetPasswordRequest - (*AdminResetPasswordResponse)(nil), // 11: admin.v1.AdminResetPasswordResponse - (*AssignRoleRequest)(nil), // 12: admin.v1.AssignRoleRequest - (*AssignRoleResponse)(nil), // 13: admin.v1.AssignRoleResponse - (*RevokeRoleRequest)(nil), // 14: admin.v1.RevokeRoleRequest - (*RevokeRoleResponse)(nil), // 15: admin.v1.RevokeRoleResponse - (*BlockIpRequest)(nil), // 16: admin.v1.BlockIpRequest - (*BlockIpResponse)(nil), // 17: admin.v1.BlockIpResponse - (*UnblockIpRequest)(nil), // 18: admin.v1.UnblockIpRequest - (*UnblockIpResponse)(nil), // 19: admin.v1.UnblockIpResponse - (*SyncUsersToSearchRequest)(nil), // 20: admin.v1.SyncUsersToSearchRequest - (*SyncUsersToSearchResponse)(nil), // 21: admin.v1.SyncUsersToSearchResponse + (*CreateUserRequest)(nil), // 0: admin.v1.CreateUserRequest + (*CreateUserResponse)(nil), // 1: admin.v1.CreateUserResponse + (*DeleteUserRequest)(nil), // 2: admin.v1.DeleteUserRequest + (*DeleteUserResponse)(nil), // 3: admin.v1.DeleteUserResponse + (*BlockUserRequest)(nil), // 4: admin.v1.BlockUserRequest + (*BlockUserResponse)(nil), // 5: admin.v1.BlockUserResponse + (*UnblockUserRequest)(nil), // 6: admin.v1.UnblockUserRequest + (*UnblockUserResponse)(nil), // 7: admin.v1.UnblockUserResponse + (*ChangeDataRequest)(nil), // 8: admin.v1.ChangeDataRequest + (*ChangeDataResponse)(nil), // 9: admin.v1.ChangeDataResponse + (*AdminResetPasswordRequest)(nil), // 10: admin.v1.AdminResetPasswordRequest + (*AdminResetPasswordResponse)(nil), // 11: admin.v1.AdminResetPasswordResponse + (*AssignRoleRequest)(nil), // 12: admin.v1.AssignRoleRequest + (*AssignRoleResponse)(nil), // 13: admin.v1.AssignRoleResponse + (*RevokeRoleRequest)(nil), // 14: admin.v1.RevokeRoleRequest + (*RevokeRoleResponse)(nil), // 15: admin.v1.RevokeRoleResponse + (*BlockIpRequest)(nil), // 16: admin.v1.BlockIpRequest + (*BlockIpResponse)(nil), // 17: admin.v1.BlockIpResponse + (*UnblockIpRequest)(nil), // 18: admin.v1.UnblockIpRequest + (*UnblockIpResponse)(nil), // 19: admin.v1.UnblockIpResponse + (*SyncUsersToSearchRequest)(nil), // 20: admin.v1.SyncUsersToSearchRequest + (*SyncUsersToSearchResponse)(nil), // 21: admin.v1.SyncUsersToSearchResponse + (*GetAllPermissionsAdminRequest)(nil), // 22: admin.v1.GetAllPermissionsAdminRequest + (*PermissionAdmin)(nil), // 23: admin.v1.PermissionAdmin + (*GetAllPermissionsAdminResponse)(nil), // 24: admin.v1.GetAllPermissionsAdminResponse + (*GetAllRolesAdminRequest)(nil), // 25: admin.v1.GetAllRolesAdminRequest + (*RolesAdmin)(nil), // 26: admin.v1.RolesAdmin + (*GetAllRolesAdminResponse)(nil), // 27: admin.v1.GetAllRolesAdminResponse + (*CreateRoleAdminRequest)(nil), // 28: admin.v1.CreateRoleAdminRequest + (*UpdateRoleAdminRequest)(nil), // 29: admin.v1.UpdateRoleAdminRequest + (*ModifyRoleAdminResponse)(nil), // 30: admin.v1.ModifyRoleAdminResponse + (*DeleteRoleAdminRequest)(nil), // 31: admin.v1.DeleteRoleAdminRequest + (*DeleteRoleAdminResponse)(nil), // 32: admin.v1.DeleteRoleAdminResponse + (*CreatePermissionAdminRequest)(nil), // 33: admin.v1.CreatePermissionAdminRequest + (*UpdatePermissionAdminRequest)(nil), // 34: admin.v1.UpdatePermissionAdminRequest + (*ModifyPermissionAdminResponse)(nil), // 35: admin.v1.ModifyPermissionAdminResponse } var file_admin_admin_account_proto_depIdxs = []int32{ - 0, // 0: admin.v1.AdminService.CreateUser:input_type -> admin.v1.CreateUserRequest - 2, // 1: admin.v1.AdminService.DeleteUser:input_type -> admin.v1.DeleteUserRequest - 4, // 2: admin.v1.AdminService.BlockUser:input_type -> admin.v1.BlockUserRequest - 6, // 3: admin.v1.AdminService.UnblockUser:input_type -> admin.v1.UnblockUserRequest - 8, // 4: admin.v1.AdminService.ChangeData:input_type -> admin.v1.ChangeDataRequest - 10, // 5: admin.v1.AdminService.AdminResetPassword:input_type -> admin.v1.AdminResetPasswordRequest - 12, // 6: admin.v1.AdminService.AssignRole:input_type -> admin.v1.AssignRoleRequest - 14, // 7: admin.v1.AdminService.RevokeRole:input_type -> admin.v1.RevokeRoleRequest - 16, // 8: admin.v1.AdminService.BlockIp:input_type -> admin.v1.BlockIpRequest - 18, // 9: admin.v1.AdminService.UnblockIp:input_type -> admin.v1.UnblockIpRequest - 20, // 10: admin.v1.AdminService.SyncUsersToSearch:input_type -> admin.v1.SyncUsersToSearchRequest - 1, // 11: admin.v1.AdminService.CreateUser:output_type -> admin.v1.CreateUserResponse - 3, // 12: admin.v1.AdminService.DeleteUser:output_type -> admin.v1.DeleteUserResponse - 5, // 13: admin.v1.AdminService.BlockUser:output_type -> admin.v1.BlockUserResponse - 7, // 14: admin.v1.AdminService.UnblockUser:output_type -> admin.v1.UnblockUserResponse - 9, // 15: admin.v1.AdminService.ChangeData:output_type -> admin.v1.ChangeDataResponse - 11, // 16: admin.v1.AdminService.AdminResetPassword:output_type -> admin.v1.AdminResetPasswordResponse - 13, // 17: admin.v1.AdminService.AssignRole:output_type -> admin.v1.AssignRoleResponse - 15, // 18: admin.v1.AdminService.RevokeRole:output_type -> admin.v1.RevokeRoleResponse - 17, // 19: admin.v1.AdminService.BlockIp:output_type -> admin.v1.BlockIpResponse - 19, // 20: admin.v1.AdminService.UnblockIp:output_type -> admin.v1.UnblockIpResponse - 21, // 21: admin.v1.AdminService.SyncUsersToSearch:output_type -> admin.v1.SyncUsersToSearchResponse - 11, // [11:22] is the sub-list for method output_type - 0, // [0:11] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 23, // 0: admin.v1.GetAllPermissionsAdminResponse.permissions:type_name -> admin.v1.PermissionAdmin + 26, // 1: admin.v1.GetAllRolesAdminResponse.roles:type_name -> admin.v1.RolesAdmin + 0, // 2: admin.v1.AdminService.CreateUser:input_type -> admin.v1.CreateUserRequest + 2, // 3: admin.v1.AdminService.DeleteUser:input_type -> admin.v1.DeleteUserRequest + 4, // 4: admin.v1.AdminService.BlockUser:input_type -> admin.v1.BlockUserRequest + 6, // 5: admin.v1.AdminService.UnblockUser:input_type -> admin.v1.UnblockUserRequest + 8, // 6: admin.v1.AdminService.ChangeData:input_type -> admin.v1.ChangeDataRequest + 10, // 7: admin.v1.AdminService.AdminResetPassword:input_type -> admin.v1.AdminResetPasswordRequest + 12, // 8: admin.v1.AdminService.AssignRole:input_type -> admin.v1.AssignRoleRequest + 14, // 9: admin.v1.AdminService.RevokeRole:input_type -> admin.v1.RevokeRoleRequest + 16, // 10: admin.v1.AdminService.BlockIp:input_type -> admin.v1.BlockIpRequest + 18, // 11: admin.v1.AdminService.UnblockIp:input_type -> admin.v1.UnblockIpRequest + 20, // 12: admin.v1.AdminService.SyncUsersToSearch:input_type -> admin.v1.SyncUsersToSearchRequest + 22, // 13: admin.v1.AdminService.GetAllPermissions:input_type -> admin.v1.GetAllPermissionsAdminRequest + 25, // 14: admin.v1.AdminService.GetAllRoles:input_type -> admin.v1.GetAllRolesAdminRequest + 28, // 15: admin.v1.AdminService.CreateRole:input_type -> admin.v1.CreateRoleAdminRequest + 29, // 16: admin.v1.AdminService.UpdateRole:input_type -> admin.v1.UpdateRoleAdminRequest + 31, // 17: admin.v1.AdminService.DeleteRole:input_type -> admin.v1.DeleteRoleAdminRequest + 33, // 18: admin.v1.AdminService.CreatePermission:input_type -> admin.v1.CreatePermissionAdminRequest + 34, // 19: admin.v1.AdminService.UpdatePermission:input_type -> admin.v1.UpdatePermissionAdminRequest + 1, // 20: admin.v1.AdminService.CreateUser:output_type -> admin.v1.CreateUserResponse + 3, // 21: admin.v1.AdminService.DeleteUser:output_type -> admin.v1.DeleteUserResponse + 5, // 22: admin.v1.AdminService.BlockUser:output_type -> admin.v1.BlockUserResponse + 7, // 23: admin.v1.AdminService.UnblockUser:output_type -> admin.v1.UnblockUserResponse + 9, // 24: admin.v1.AdminService.ChangeData:output_type -> admin.v1.ChangeDataResponse + 11, // 25: admin.v1.AdminService.AdminResetPassword:output_type -> admin.v1.AdminResetPasswordResponse + 13, // 26: admin.v1.AdminService.AssignRole:output_type -> admin.v1.AssignRoleResponse + 15, // 27: admin.v1.AdminService.RevokeRole:output_type -> admin.v1.RevokeRoleResponse + 17, // 28: admin.v1.AdminService.BlockIp:output_type -> admin.v1.BlockIpResponse + 19, // 29: admin.v1.AdminService.UnblockIp:output_type -> admin.v1.UnblockIpResponse + 21, // 30: admin.v1.AdminService.SyncUsersToSearch:output_type -> admin.v1.SyncUsersToSearchResponse + 24, // 31: admin.v1.AdminService.GetAllPermissions:output_type -> admin.v1.GetAllPermissionsAdminResponse + 27, // 32: admin.v1.AdminService.GetAllRoles:output_type -> admin.v1.GetAllRolesAdminResponse + 30, // 33: admin.v1.AdminService.CreateRole:output_type -> admin.v1.ModifyRoleAdminResponse + 30, // 34: admin.v1.AdminService.UpdateRole:output_type -> admin.v1.ModifyRoleAdminResponse + 32, // 35: admin.v1.AdminService.DeleteRole:output_type -> admin.v1.DeleteRoleAdminResponse + 35, // 36: admin.v1.AdminService.CreatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse + 35, // 37: admin.v1.AdminService.UpdatePermission:output_type -> admin.v1.ModifyPermissionAdminResponse + 20, // [20:38] is the sub-list for method output_type + 2, // [2:20] 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_admin_account_proto_init() } @@ -1428,13 +2325,15 @@ func file_admin_admin_account_proto_init() { file_admin_admin_account_proto_msgTypes[4].OneofWrappers = []any{} file_admin_admin_account_proto_msgTypes[8].OneofWrappers = []any{} file_admin_admin_account_proto_msgTypes[16].OneofWrappers = []any{} + file_admin_admin_account_proto_msgTypes[29].OneofWrappers = []any{} + file_admin_admin_account_proto_msgTypes[32].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_admin_account_proto_rawDesc), len(file_admin_admin_account_proto_rawDesc)), NumEnums: 0, - NumMessages: 22, + NumMessages: 36, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/admin/admin-account_grpc.pb.go b/gen/go/admin/admin-account_grpc.pb.go index 9cc0bec..d6a5d07 100644 --- a/gen/go/admin/admin-account_grpc.pb.go +++ b/gen/go/admin/admin-account_grpc.pb.go @@ -30,6 +30,13 @@ const ( AdminService_BlockIp_FullMethodName = "/admin.v1.AdminService/BlockIp" AdminService_UnblockIp_FullMethodName = "/admin.v1.AdminService/UnblockIp" AdminService_SyncUsersToSearch_FullMethodName = "/admin.v1.AdminService/SyncUsersToSearch" + AdminService_GetAllPermissions_FullMethodName = "/admin.v1.AdminService/GetAllPermissions" + AdminService_GetAllRoles_FullMethodName = "/admin.v1.AdminService/GetAllRoles" + AdminService_CreateRole_FullMethodName = "/admin.v1.AdminService/CreateRole" + AdminService_UpdateRole_FullMethodName = "/admin.v1.AdminService/UpdateRole" + AdminService_DeleteRole_FullMethodName = "/admin.v1.AdminService/DeleteRole" + AdminService_CreatePermission_FullMethodName = "/admin.v1.AdminService/CreatePermission" + AdminService_UpdatePermission_FullMethodName = "/admin.v1.AdminService/UpdatePermission" ) // AdminServiceClient is the client API for AdminService service. @@ -54,6 +61,14 @@ type AdminServiceClient interface { UnblockIp(ctx context.Context, in *UnblockIpRequest, opts ...grpc.CallOption) (*UnblockIpResponse, error) // Синхронизация с поисковым движком (Elasticsearch) SyncUsersToSearch(ctx context.Context, in *SyncUsersToSearchRequest, opts ...grpc.CallOption) (*SyncUsersToSearchResponse, error) + // RBAC + GetAllPermissions(ctx context.Context, in *GetAllPermissionsAdminRequest, opts ...grpc.CallOption) (*GetAllPermissionsAdminResponse, error) + GetAllRoles(ctx context.Context, in *GetAllRolesAdminRequest, opts ...grpc.CallOption) (*GetAllRolesAdminResponse, error) + CreateRole(ctx context.Context, in *CreateRoleAdminRequest, opts ...grpc.CallOption) (*ModifyRoleAdminResponse, error) + UpdateRole(ctx context.Context, in *UpdateRoleAdminRequest, opts ...grpc.CallOption) (*ModifyRoleAdminResponse, error) + DeleteRole(ctx context.Context, in *DeleteRoleAdminRequest, opts ...grpc.CallOption) (*DeleteRoleAdminResponse, error) + CreatePermission(ctx context.Context, in *CreatePermissionAdminRequest, opts ...grpc.CallOption) (*ModifyPermissionAdminResponse, error) + UpdatePermission(ctx context.Context, in *UpdatePermissionAdminRequest, opts ...grpc.CallOption) (*ModifyPermissionAdminResponse, error) } type adminServiceClient struct { @@ -174,6 +189,76 @@ func (c *adminServiceClient) SyncUsersToSearch(ctx context.Context, in *SyncUser return out, nil } +func (c *adminServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsAdminRequest, opts ...grpc.CallOption) (*GetAllPermissionsAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAllPermissionsAdminResponse) + err := c.cc.Invoke(ctx, AdminService_GetAllPermissions_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesAdminRequest, opts ...grpc.CallOption) (*GetAllRolesAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetAllRolesAdminResponse) + err := c.cc.Invoke(ctx, AdminService_GetAllRoles_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) CreateRole(ctx context.Context, in *CreateRoleAdminRequest, opts ...grpc.CallOption) (*ModifyRoleAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyRoleAdminResponse) + err := c.cc.Invoke(ctx, AdminService_CreateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) UpdateRole(ctx context.Context, in *UpdateRoleAdminRequest, opts ...grpc.CallOption) (*ModifyRoleAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyRoleAdminResponse) + err := c.cc.Invoke(ctx, AdminService_UpdateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleAdminRequest, opts ...grpc.CallOption) (*DeleteRoleAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteRoleAdminResponse) + err := c.cc.Invoke(ctx, AdminService_DeleteRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) CreatePermission(ctx context.Context, in *CreatePermissionAdminRequest, opts ...grpc.CallOption) (*ModifyPermissionAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyPermissionAdminResponse) + err := c.cc.Invoke(ctx, AdminService_CreatePermission_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminServiceClient) UpdatePermission(ctx context.Context, in *UpdatePermissionAdminRequest, opts ...grpc.CallOption) (*ModifyPermissionAdminResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ModifyPermissionAdminResponse) + err := c.cc.Invoke(ctx, AdminService_UpdatePermission_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // AdminServiceServer is the server API for AdminService service. // All implementations must embed UnimplementedAdminServiceServer // for forward compatibility. @@ -196,6 +281,14 @@ type AdminServiceServer interface { UnblockIp(context.Context, *UnblockIpRequest) (*UnblockIpResponse, error) // Синхронизация с поисковым движком (Elasticsearch) SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error) + // RBAC + GetAllPermissions(context.Context, *GetAllPermissionsAdminRequest) (*GetAllPermissionsAdminResponse, error) + GetAllRoles(context.Context, *GetAllRolesAdminRequest) (*GetAllRolesAdminResponse, error) + CreateRole(context.Context, *CreateRoleAdminRequest) (*ModifyRoleAdminResponse, error) + UpdateRole(context.Context, *UpdateRoleAdminRequest) (*ModifyRoleAdminResponse, error) + DeleteRole(context.Context, *DeleteRoleAdminRequest) (*DeleteRoleAdminResponse, error) + CreatePermission(context.Context, *CreatePermissionAdminRequest) (*ModifyPermissionAdminResponse, error) + UpdatePermission(context.Context, *UpdatePermissionAdminRequest) (*ModifyPermissionAdminResponse, error) mustEmbedUnimplementedAdminServiceServer() } @@ -239,6 +332,27 @@ func (UnimplementedAdminServiceServer) UnblockIp(context.Context, *UnblockIpRequ func (UnimplementedAdminServiceServer) SyncUsersToSearch(context.Context, *SyncUsersToSearchRequest) (*SyncUsersToSearchResponse, error) { return nil, status.Error(codes.Unimplemented, "method SyncUsersToSearch not implemented") } +func (UnimplementedAdminServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsAdminRequest) (*GetAllPermissionsAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented") +} +func (UnimplementedAdminServiceServer) GetAllRoles(context.Context, *GetAllRolesAdminRequest) (*GetAllRolesAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented") +} +func (UnimplementedAdminServiceServer) CreateRole(context.Context, *CreateRoleAdminRequest) (*ModifyRoleAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented") +} +func (UnimplementedAdminServiceServer) UpdateRole(context.Context, *UpdateRoleAdminRequest) (*ModifyRoleAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented") +} +func (UnimplementedAdminServiceServer) DeleteRole(context.Context, *DeleteRoleAdminRequest) (*DeleteRoleAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented") +} +func (UnimplementedAdminServiceServer) CreatePermission(context.Context, *CreatePermissionAdminRequest) (*ModifyPermissionAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method CreatePermission not implemented") +} +func (UnimplementedAdminServiceServer) UpdatePermission(context.Context, *UpdatePermissionAdminRequest) (*ModifyPermissionAdminResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdatePermission not implemented") +} func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {} func (UnimplementedAdminServiceServer) testEmbeddedByValue() {} @@ -458,6 +572,132 @@ func _AdminService_SyncUsersToSearch_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _AdminService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllPermissionsAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).GetAllPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_GetAllPermissions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).GetAllPermissions(ctx, req.(*GetAllPermissionsAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllRolesAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).GetAllRoles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_GetAllRoles_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).GetAllRoles(ctx, req.(*GetAllRolesAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRoleAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_CreateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).CreateRole(ctx, req.(*CreateRoleAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRoleAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_UpdateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).UpdateRole(ctx, req.(*UpdateRoleAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRoleAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_DeleteRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).DeleteRole(ctx, req.(*DeleteRoleAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_CreatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePermissionAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).CreatePermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_CreatePermission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).CreatePermission(ctx, req.(*CreatePermissionAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminService_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePermissionAdminRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServiceServer).UpdatePermission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminService_UpdatePermission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServiceServer).UpdatePermission(ctx, req.(*UpdatePermissionAdminRequest)) + } + return interceptor(ctx, in, info, handler) +} + // AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -509,6 +749,34 @@ var AdminService_ServiceDesc = grpc.ServiceDesc{ MethodName: "SyncUsersToSearch", Handler: _AdminService_SyncUsersToSearch_Handler, }, + { + MethodName: "GetAllPermissions", + Handler: _AdminService_GetAllPermissions_Handler, + }, + { + MethodName: "GetAllRoles", + Handler: _AdminService_GetAllRoles_Handler, + }, + { + MethodName: "CreateRole", + Handler: _AdminService_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _AdminService_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _AdminService_DeleteRole_Handler, + }, + { + MethodName: "CreatePermission", + Handler: _AdminService_CreatePermission_Handler, + }, + { + MethodName: "UpdatePermission", + Handler: _AdminService_UpdatePermission_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin/admin-account.proto",