chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-11 17:05:04 +00:00
parent 8146b671dd
commit bd2ccecd5d
6 changed files with 313 additions and 53 deletions

View File

@@ -925,6 +925,58 @@ func (x *GetUserRolesResponse) GetMaxRoleLevel() int32 {
return 0
}
type AssignRolesByNameRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AssignRolesByNameRequest) Reset() {
*x = AssignRolesByNameRequest{}
mi := &file_admin_rbac_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AssignRolesByNameRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AssignRolesByNameRequest) ProtoMessage() {}
func (x *AssignRolesByNameRequest) ProtoReflect() protoreflect.Message {
mi := &file_admin_rbac_proto_msgTypes[16]
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 AssignRolesByNameRequest.ProtoReflect.Descriptor instead.
func (*AssignRolesByNameRequest) Descriptor() ([]byte, []int) {
return file_admin_rbac_proto_rawDescGZIP(), []int{16}
}
func (x *AssignRolesByNameRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *AssignRolesByNameRequest) GetRoles() []string {
if x != nil {
return x.Roles
}
return nil
}
type AssignRoleToUserRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
@@ -935,7 +987,7 @@ type AssignRoleToUserRequest struct {
func (x *AssignRoleToUserRequest) Reset() {
*x = AssignRoleToUserRequest{}
mi := &file_admin_rbac_proto_msgTypes[16]
mi := &file_admin_rbac_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -947,7 +999,7 @@ func (x *AssignRoleToUserRequest) String() string {
func (*AssignRoleToUserRequest) ProtoMessage() {}
func (x *AssignRoleToUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_admin_rbac_proto_msgTypes[16]
mi := &file_admin_rbac_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -960,7 +1012,7 @@ func (x *AssignRoleToUserRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AssignRoleToUserRequest.ProtoReflect.Descriptor instead.
func (*AssignRoleToUserRequest) Descriptor() ([]byte, []int) {
return file_admin_rbac_proto_rawDescGZIP(), []int{16}
return file_admin_rbac_proto_rawDescGZIP(), []int{17}
}
func (x *AssignRoleToUserRequest) GetUserId() string {
@@ -987,7 +1039,7 @@ type RevokeRoleFromUserRequest struct {
func (x *RevokeRoleFromUserRequest) Reset() {
*x = RevokeRoleFromUserRequest{}
mi := &file_admin_rbac_proto_msgTypes[17]
mi := &file_admin_rbac_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -999,7 +1051,7 @@ func (x *RevokeRoleFromUserRequest) String() string {
func (*RevokeRoleFromUserRequest) ProtoMessage() {}
func (x *RevokeRoleFromUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_admin_rbac_proto_msgTypes[17]
mi := &file_admin_rbac_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1012,7 +1064,7 @@ func (x *RevokeRoleFromUserRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RevokeRoleFromUserRequest.ProtoReflect.Descriptor instead.
func (*RevokeRoleFromUserRequest) Descriptor() ([]byte, []int) {
return file_admin_rbac_proto_rawDescGZIP(), []int{17}
return file_admin_rbac_proto_rawDescGZIP(), []int{18}
}
func (x *RevokeRoleFromUserRequest) GetUserId() string {
@@ -1039,7 +1091,7 @@ type SyncLdapRolesRequest struct {
func (x *SyncLdapRolesRequest) Reset() {
*x = SyncLdapRolesRequest{}
mi := &file_admin_rbac_proto_msgTypes[18]
mi := &file_admin_rbac_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1051,7 +1103,7 @@ func (x *SyncLdapRolesRequest) String() string {
func (*SyncLdapRolesRequest) ProtoMessage() {}
func (x *SyncLdapRolesRequest) ProtoReflect() protoreflect.Message {
mi := &file_admin_rbac_proto_msgTypes[18]
mi := &file_admin_rbac_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1064,7 +1116,7 @@ func (x *SyncLdapRolesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncLdapRolesRequest.ProtoReflect.Descriptor instead.
func (*SyncLdapRolesRequest) Descriptor() ([]byte, []int) {
return file_admin_rbac_proto_rawDescGZIP(), []int{18}
return file_admin_rbac_proto_rawDescGZIP(), []int{19}
}
func (x *SyncLdapRolesRequest) GetUserId() string {
@@ -1148,7 +1200,10 @@ const file_admin_rbac_proto_rawDesc = "" +
"\x14GetUserRolesResponse\x12\x14\n" +
"\x05roles\x18\x01 \x03(\tR\x05roles\x12 \n" +
"\vpermissions\x18\x02 \x03(\tR\vpermissions\x12$\n" +
"\x0emax_role_level\x18\x03 \x01(\x05R\fmaxRoleLevel\"K\n" +
"\x0emax_role_level\x18\x03 \x01(\x05R\fmaxRoleLevel\"I\n" +
"\x18AssignRolesByNameRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x14\n" +
"\x05roles\x18\x02 \x03(\tR\x05roles\"K\n" +
"\x17AssignRoleToUserRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x17\n" +
"\arole_id\x18\x02 \x01(\x05R\x06roleId\"M\n" +
@@ -1158,7 +1213,7 @@ const file_admin_rbac_proto_rawDesc = "" +
"\x14SyncLdapRolesRequest\x12\x17\n" +
"\auser_id\x18\x01 \x01(\tR\x06userId\x12\x1f\n" +
"\vldap_groups\x18\x02 \x03(\tR\n" +
"ldapGroups2\x8c\a\n" +
"ldapGroups2\xe1\a\n" +
"\vRbacService\x12E\n" +
"\n" +
"CreateRole\x12\x1a.rbac.v1.CreateRoleRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12E\n" +
@@ -1169,7 +1224,8 @@ const file_admin_rbac_proto_rawDesc = "" +
"\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.GetAllRolesResponse\x12Y\n" +
"\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponse\x12S\n" +
"\x11AssignRolesByName\x12!.rbac.v1.AssignRolesByNameRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12Y\n" +
"\x1aGetUserRolesAndPermissions\x12\x1c.rbac.v1.GetUserRolesRequest\x1a\x1d.rbac.v1.GetUserRolesResponse\x12Q\n" +
"\x10AssignRoleToUser\x12 .rbac.v1.AssignRoleToUserRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12U\n" +
"\x12RevokeRoleFromUser\x12\".rbac.v1.RevokeRoleFromUserRequest\x1a\x1b.rbac.v1.ModifyRoleResponse\x12K\n" +
@@ -1187,7 +1243,7 @@ func file_admin_rbac_proto_rawDescGZIP() []byte {
return file_admin_rbac_proto_rawDescData
}
var file_admin_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_admin_rbac_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_admin_rbac_proto_goTypes = []any{
(*GetAllPermissionsRequest)(nil), // 0: rbac.v1.GetAllPermissionsRequest
(*GetAllPermissionsResponse)(nil), // 1: rbac.v1.GetAllPermissionsResponse
@@ -1205,9 +1261,10 @@ var file_admin_rbac_proto_goTypes = []any{
(*Roles)(nil), // 13: rbac.v1.Roles
(*GetUserRolesRequest)(nil), // 14: rbac.v1.GetUserRolesRequest
(*GetUserRolesResponse)(nil), // 15: rbac.v1.GetUserRolesResponse
(*AssignRoleToUserRequest)(nil), // 16: rbac.v1.AssignRoleToUserRequest
(*RevokeRoleFromUserRequest)(nil), // 17: rbac.v1.RevokeRoleFromUserRequest
(*SyncLdapRolesRequest)(nil), // 18: rbac.v1.SyncLdapRolesRequest
(*AssignRolesByNameRequest)(nil), // 16: rbac.v1.AssignRolesByNameRequest
(*AssignRoleToUserRequest)(nil), // 17: rbac.v1.AssignRoleToUserRequest
(*RevokeRoleFromUserRequest)(nil), // 18: rbac.v1.RevokeRoleFromUserRequest
(*SyncLdapRolesRequest)(nil), // 19: rbac.v1.SyncLdapRolesRequest
}
var file_admin_rbac_proto_depIdxs = []int32{
2, // 0: rbac.v1.GetAllPermissionsResponse.permissions:type_name -> rbac.v1.Permission
@@ -1219,23 +1276,25 @@ var file_admin_rbac_proto_depIdxs = []int32{
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
14, // 9: rbac.v1.RbacService.GetUserRolesAndPermissions:input_type -> rbac.v1.GetUserRolesRequest
16, // 10: rbac.v1.RbacService.AssignRoleToUser:input_type -> rbac.v1.AssignRoleToUserRequest
17, // 11: rbac.v1.RbacService.RevokeRoleFromUser:input_type -> rbac.v1.RevokeRoleFromUserRequest
18, // 12: rbac.v1.RbacService.SyncLdapRoles:input_type -> rbac.v1.SyncLdapRolesRequest
7, // 13: rbac.v1.RbacService.CreateRole:output_type -> rbac.v1.ModifyRoleResponse
7, // 14: rbac.v1.RbacService.UpdateRole:output_type -> rbac.v1.ModifyRoleResponse
9, // 15: rbac.v1.RbacService.DeleteRole:output_type -> rbac.v1.DeleteRoleResponse
12, // 16: rbac.v1.RbacService.CreatePermission:output_type -> rbac.v1.ModifyPermissionResponse
12, // 17: rbac.v1.RbacService.UpdatePermission:output_type -> rbac.v1.ModifyPermissionResponse
1, // 18: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
4, // 19: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
15, // 20: rbac.v1.RbacService.GetUserRolesAndPermissions:output_type -> rbac.v1.GetUserRolesResponse
7, // 21: rbac.v1.RbacService.AssignRoleToUser:output_type -> rbac.v1.ModifyRoleResponse
7, // 22: rbac.v1.RbacService.RevokeRoleFromUser:output_type -> rbac.v1.ModifyRoleResponse
7, // 23: rbac.v1.RbacService.SyncLdapRoles:output_type -> rbac.v1.ModifyRoleResponse
13, // [13:24] is the sub-list for method output_type
2, // [2:13] is the sub-list for method input_type
16, // 9: rbac.v1.RbacService.AssignRolesByName:input_type -> rbac.v1.AssignRolesByNameRequest
14, // 10: rbac.v1.RbacService.GetUserRolesAndPermissions:input_type -> rbac.v1.GetUserRolesRequest
17, // 11: rbac.v1.RbacService.AssignRoleToUser:input_type -> rbac.v1.AssignRoleToUserRequest
18, // 12: rbac.v1.RbacService.RevokeRoleFromUser:input_type -> rbac.v1.RevokeRoleFromUserRequest
19, // 13: rbac.v1.RbacService.SyncLdapRoles:input_type -> rbac.v1.SyncLdapRolesRequest
7, // 14: rbac.v1.RbacService.CreateRole:output_type -> rbac.v1.ModifyRoleResponse
7, // 15: rbac.v1.RbacService.UpdateRole:output_type -> rbac.v1.ModifyRoleResponse
9, // 16: rbac.v1.RbacService.DeleteRole:output_type -> rbac.v1.DeleteRoleResponse
12, // 17: rbac.v1.RbacService.CreatePermission:output_type -> rbac.v1.ModifyPermissionResponse
12, // 18: rbac.v1.RbacService.UpdatePermission:output_type -> rbac.v1.ModifyPermissionResponse
1, // 19: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
4, // 20: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
7, // 21: rbac.v1.RbacService.AssignRolesByName:output_type -> rbac.v1.ModifyRoleResponse
15, // 22: rbac.v1.RbacService.GetUserRolesAndPermissions:output_type -> rbac.v1.GetUserRolesResponse
7, // 23: rbac.v1.RbacService.AssignRoleToUser:output_type -> rbac.v1.ModifyRoleResponse
7, // 24: rbac.v1.RbacService.RevokeRoleFromUser:output_type -> rbac.v1.ModifyRoleResponse
7, // 25: rbac.v1.RbacService.SyncLdapRoles:output_type -> rbac.v1.ModifyRoleResponse
14, // [14:26] is the sub-list for method output_type
2, // [2:14] 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
@@ -1254,7 +1313,7 @@ func file_admin_rbac_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_admin_rbac_proto_rawDesc), len(file_admin_rbac_proto_rawDesc)),
NumEnums: 0,
NumMessages: 19,
NumMessages: 20,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -26,6 +26,7 @@ const (
RbacService_UpdatePermission_FullMethodName = "/rbac.v1.RbacService/UpdatePermission"
RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions"
RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles"
RbacService_AssignRolesByName_FullMethodName = "/rbac.v1.RbacService/AssignRolesByName"
RbacService_GetUserRolesAndPermissions_FullMethodName = "/rbac.v1.RbacService/GetUserRolesAndPermissions"
RbacService_AssignRoleToUser_FullMethodName = "/rbac.v1.RbacService/AssignRoleToUser"
RbacService_RevokeRoleFromUser_FullMethodName = "/rbac.v1.RbacService/RevokeRoleFromUser"
@@ -43,6 +44,7 @@ type RbacServiceClient interface {
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)
AssignRolesByName(ctx context.Context, in *AssignRolesByNameRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
GetUserRolesAndPermissions(ctx context.Context, in *GetUserRolesRequest, opts ...grpc.CallOption) (*GetUserRolesResponse, error)
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
RevokeRoleFromUser(ctx context.Context, in *RevokeRoleFromUserRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error)
@@ -127,6 +129,16 @@ func (c *rbacServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequ
return out, nil
}
func (c *rbacServiceClient) AssignRolesByName(ctx context.Context, in *AssignRolesByNameRequest, opts ...grpc.CallOption) (*ModifyRoleResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ModifyRoleResponse)
err := c.cc.Invoke(ctx, RbacService_AssignRolesByName_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *rbacServiceClient) GetUserRolesAndPermissions(ctx context.Context, in *GetUserRolesRequest, opts ...grpc.CallOption) (*GetUserRolesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetUserRolesResponse)
@@ -178,6 +190,7 @@ type RbacServiceServer interface {
UpdatePermission(context.Context, *UpdatePermissionRequest) (*ModifyPermissionResponse, error)
GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error)
GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
AssignRolesByName(context.Context, *AssignRolesByNameRequest) (*ModifyRoleResponse, error)
GetUserRolesAndPermissions(context.Context, *GetUserRolesRequest) (*GetUserRolesResponse, error)
AssignRoleToUser(context.Context, *AssignRoleToUserRequest) (*ModifyRoleResponse, error)
RevokeRoleFromUser(context.Context, *RevokeRoleFromUserRequest) (*ModifyRoleResponse, error)
@@ -213,6 +226,9 @@ func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAll
func (UnimplementedRbacServiceServer) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented")
}
func (UnimplementedRbacServiceServer) AssignRolesByName(context.Context, *AssignRolesByNameRequest) (*ModifyRoleResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AssignRolesByName not implemented")
}
func (UnimplementedRbacServiceServer) GetUserRolesAndPermissions(context.Context, *GetUserRolesRequest) (*GetUserRolesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetUserRolesAndPermissions not implemented")
}
@@ -372,6 +388,24 @@ func _RbacService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _RbacService_AssignRolesByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AssignRolesByNameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RbacServiceServer).AssignRolesByName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RbacService_AssignRolesByName_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RbacServiceServer).AssignRolesByName(ctx, req.(*AssignRolesByNameRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RbacService_GetUserRolesAndPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRolesRequest)
if err := dec(in); err != nil {
@@ -479,6 +513,10 @@ var RbacService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetAllRoles",
Handler: _RbacService_GetAllRoles_Handler,
},
{
MethodName: "AssignRolesByName",
Handler: _RbacService_AssignRolesByName_Handler,
},
{
MethodName: "GetUserRolesAndPermissions",
Handler: _RbacService_GetUserRolesAndPermissions_Handler,