chore: auto-generate protobuf files [skip ci]
This commit is contained in:
@@ -311,8 +311,8 @@ const file_rbax_proto_rawDesc = "" +
|
|||||||
"\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" +
|
"\x05level\x18\x03 \x01(\x05R\x05level\x12 \n" +
|
||||||
"\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" +
|
"\vpermissions\x18\x04 \x03(\tR\vpermissions\x12!\n" +
|
||||||
"\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" +
|
"\fldap_mapping\x18\x05 \x03(\tR\vldapMapping\x12\x1a\n" +
|
||||||
"\baccounts\x18\x06 \x03(\tR\baccounts2\xb7\x01\n" +
|
"\baccounts\x18\x06 \x03(\tR\baccounts2\xb3\x01\n" +
|
||||||
"\x0fLdapAuthService\x12Z\n" +
|
"\vRbacService\x12Z\n" +
|
||||||
"\x11GetAllPermissions\x12!.rbac.v1.GetAllPermissionsRequest\x1a\".rbac.v1.GetAllPermissionsResponse\x12H\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"
|
"\vGetAllRoles\x12\x1b.rbac.v1.GetAllRolesRequest\x1a\x1c.rbac.v1.GetAllRolesResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3"
|
||||||
|
|
||||||
@@ -336,10 +336,10 @@ var file_rbax_proto_goTypes = []any{
|
|||||||
(*GetAllRolesResponse)(nil), // 3: rbac.v1.GetAllRolesResponse
|
(*GetAllRolesResponse)(nil), // 3: rbac.v1.GetAllRolesResponse
|
||||||
}
|
}
|
||||||
var file_rbax_proto_depIdxs = []int32{
|
var file_rbax_proto_depIdxs = []int32{
|
||||||
0, // 0: rbac.v1.LdapAuthService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest
|
0, // 0: rbac.v1.RbacService.GetAllPermissions:input_type -> rbac.v1.GetAllPermissionsRequest
|
||||||
2, // 1: rbac.v1.LdapAuthService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest
|
2, // 1: rbac.v1.RbacService.GetAllRoles:input_type -> rbac.v1.GetAllRolesRequest
|
||||||
1, // 2: rbac.v1.LdapAuthService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
|
1, // 2: rbac.v1.RbacService.GetAllPermissions:output_type -> rbac.v1.GetAllPermissionsResponse
|
||||||
3, // 3: rbac.v1.LdapAuthService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
|
3, // 3: rbac.v1.RbacService.GetAllRoles:output_type -> rbac.v1.GetAllRolesResponse
|
||||||
2, // [2:4] is the sub-list for method output_type
|
2, // [2:4] is the sub-list for method output_type
|
||||||
0, // [0:2] is the sub-list for method input_type
|
0, // [0:2] 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 type_name
|
||||||
|
|||||||
@@ -19,139 +19,139 @@ import (
|
|||||||
const _ = grpc.SupportPackageIsVersion9
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LdapAuthService_GetAllPermissions_FullMethodName = "/rbac.v1.LdapAuthService/GetAllPermissions"
|
RbacService_GetAllPermissions_FullMethodName = "/rbac.v1.RbacService/GetAllPermissions"
|
||||||
LdapAuthService_GetAllRoles_FullMethodName = "/rbac.v1.LdapAuthService/GetAllRoles"
|
RbacService_GetAllRoles_FullMethodName = "/rbac.v1.RbacService/GetAllRoles"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LdapAuthServiceClient is the client API for LdapAuthService service.
|
// 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.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type LdapAuthServiceClient interface {
|
type RbacServiceClient interface {
|
||||||
GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error)
|
GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error)
|
||||||
GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error)
|
GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ldapAuthServiceClient struct {
|
type rbacServiceClient struct {
|
||||||
cc grpc.ClientConnInterface
|
cc grpc.ClientConnInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLdapAuthServiceClient(cc grpc.ClientConnInterface) LdapAuthServiceClient {
|
func NewRbacServiceClient(cc grpc.ClientConnInterface) RbacServiceClient {
|
||||||
return &ldapAuthServiceClient{cc}
|
return &rbacServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ldapAuthServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) {
|
func (c *rbacServiceClient) GetAllPermissions(ctx context.Context, in *GetAllPermissionsRequest, opts ...grpc.CallOption) (*GetAllPermissionsResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetAllPermissionsResponse)
|
out := new(GetAllPermissionsResponse)
|
||||||
err := c.cc.Invoke(ctx, LdapAuthService_GetAllPermissions_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, RbacService_GetAllPermissions_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ldapAuthServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) {
|
func (c *rbacServiceClient) GetAllRoles(ctx context.Context, in *GetAllRolesRequest, opts ...grpc.CallOption) (*GetAllRolesResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetAllRolesResponse)
|
out := new(GetAllRolesResponse)
|
||||||
err := c.cc.Invoke(ctx, LdapAuthService_GetAllRoles_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, RbacService_GetAllRoles_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LdapAuthServiceServer is the server API for LdapAuthService service.
|
// RbacServiceServer is the server API for RbacService service.
|
||||||
// All implementations must embed UnimplementedLdapAuthServiceServer
|
// All implementations must embed UnimplementedRbacServiceServer
|
||||||
// for forward compatibility.
|
// for forward compatibility.
|
||||||
type LdapAuthServiceServer interface {
|
type RbacServiceServer interface {
|
||||||
GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error)
|
GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error)
|
||||||
GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
|
GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error)
|
||||||
mustEmbedUnimplementedLdapAuthServiceServer()
|
mustEmbedUnimplementedRbacServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedLdapAuthServiceServer must be embedded to have
|
// UnimplementedRbacServiceServer must be embedded to have
|
||||||
// forward compatible implementations.
|
// forward compatible implementations.
|
||||||
//
|
//
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
// pointer dereference when methods are called.
|
// pointer dereference when methods are called.
|
||||||
type UnimplementedLdapAuthServiceServer struct{}
|
type UnimplementedRbacServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedLdapAuthServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) {
|
func (UnimplementedRbacServiceServer) GetAllPermissions(context.Context, *GetAllPermissionsRequest) (*GetAllPermissionsResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented")
|
return nil, status.Error(codes.Unimplemented, "method GetAllPermissions not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedLdapAuthServiceServer) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) {
|
func (UnimplementedRbacServiceServer) GetAllRoles(context.Context, *GetAllRolesRequest) (*GetAllRolesResponse, error) {
|
||||||
return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented")
|
return nil, status.Error(codes.Unimplemented, "method GetAllRoles not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedLdapAuthServiceServer) mustEmbedUnimplementedLdapAuthServiceServer() {}
|
func (UnimplementedRbacServiceServer) mustEmbedUnimplementedRbacServiceServer() {}
|
||||||
func (UnimplementedLdapAuthServiceServer) testEmbeddedByValue() {}
|
func (UnimplementedRbacServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeLdapAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeRbacServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to LdapAuthServiceServer will
|
// Use of this interface is not recommended, as added methods to RbacServiceServer will
|
||||||
// result in compilation errors.
|
// result in compilation errors.
|
||||||
type UnsafeLdapAuthServiceServer interface {
|
type UnsafeRbacServiceServer interface {
|
||||||
mustEmbedUnimplementedLdapAuthServiceServer()
|
mustEmbedUnimplementedRbacServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterLdapAuthServiceServer(s grpc.ServiceRegistrar, srv LdapAuthServiceServer) {
|
func RegisterRbacServiceServer(s grpc.ServiceRegistrar, srv RbacServiceServer) {
|
||||||
// If the following call panics, it indicates UnimplementedLdapAuthServiceServer was
|
// If the following call panics, it indicates UnimplementedRbacServiceServer was
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
t.testEmbeddedByValue()
|
t.testEmbeddedByValue()
|
||||||
}
|
}
|
||||||
s.RegisterService(&LdapAuthService_ServiceDesc, srv)
|
s.RegisterService(&RbacService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _LdapAuthService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _RbacService_GetAllPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetAllPermissionsRequest)
|
in := new(GetAllPermissionsRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(LdapAuthServiceServer).GetAllPermissions(ctx, in)
|
return srv.(RbacServiceServer).GetAllPermissions(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: LdapAuthService_GetAllPermissions_FullMethodName,
|
FullMethod: RbacService_GetAllPermissions_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(LdapAuthServiceServer).GetAllPermissions(ctx, req.(*GetAllPermissionsRequest))
|
return srv.(RbacServiceServer).GetAllPermissions(ctx, req.(*GetAllPermissionsRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _LdapAuthService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _RbacService_GetAllRoles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetAllRolesRequest)
|
in := new(GetAllRolesRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(LdapAuthServiceServer).GetAllRoles(ctx, in)
|
return srv.(RbacServiceServer).GetAllRoles(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: LdapAuthService_GetAllRoles_FullMethodName,
|
FullMethod: RbacService_GetAllRoles_FullMethodName,
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(LdapAuthServiceServer).GetAllRoles(ctx, req.(*GetAllRolesRequest))
|
return srv.(RbacServiceServer).GetAllRoles(ctx, req.(*GetAllRolesRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LdapAuthService_ServiceDesc is the grpc.ServiceDesc for LdapAuthService service.
|
// RbacService_ServiceDesc is the grpc.ServiceDesc for RbacService service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
var LdapAuthService_ServiceDesc = grpc.ServiceDesc{
|
var RbacService_ServiceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "rbac.v1.LdapAuthService",
|
ServiceName: "rbac.v1.RbacService",
|
||||||
HandlerType: (*LdapAuthServiceServer)(nil),
|
HandlerType: (*RbacServiceServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "GetAllPermissions",
|
MethodName: "GetAllPermissions",
|
||||||
Handler: _LdapAuthService_GetAllPermissions_Handler,
|
Handler: _RbacService_GetAllPermissions_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetAllRoles",
|
MethodName: "GetAllRoles",
|
||||||
Handler: _LdapAuthService_GetAllRoles_Handler,
|
Handler: _RbacService_GetAllRoles_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
|
|||||||
12
gen/rbax.ts
12
gen/rbax.ts
@@ -40,13 +40,13 @@ export interface GetAllRolesResponse {
|
|||||||
|
|
||||||
export const RBAC_V1_PACKAGE_NAME = "rbac.v1";
|
export const RBAC_V1_PACKAGE_NAME = "rbac.v1";
|
||||||
|
|
||||||
export interface LdapAuthServiceClient {
|
export interface RbacServiceClient {
|
||||||
getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>;
|
getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>;
|
||||||
|
|
||||||
getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>;
|
getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LdapAuthServiceController {
|
export interface RbacServiceController {
|
||||||
getAllPermissions(
|
getAllPermissions(
|
||||||
request: GetAllPermissionsRequest,
|
request: GetAllPermissionsRequest,
|
||||||
metadata?: Metadata,
|
metadata?: Metadata,
|
||||||
@@ -58,19 +58,19 @@ export interface LdapAuthServiceController {
|
|||||||
): Promise<GetAllRolesResponse> | Observable<GetAllRolesResponse> | GetAllRolesResponse;
|
): Promise<GetAllRolesResponse> | Observable<GetAllRolesResponse> | GetAllRolesResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LdapAuthServiceControllerMethods() {
|
export function RbacServiceControllerMethods() {
|
||||||
return function (constructor: Function) {
|
return function (constructor: Function) {
|
||||||
const grpcMethods: string[] = ["getAllPermissions", "getAllRoles"];
|
const grpcMethods: string[] = ["getAllPermissions", "getAllRoles"];
|
||||||
for (const method of grpcMethods) {
|
for (const method of grpcMethods) {
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||||
GrpcMethod("LdapAuthService", method)(constructor.prototype[method], method, descriptor);
|
GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
|
||||||
}
|
}
|
||||||
const grpcStreamMethods: string[] = [];
|
const grpcStreamMethods: string[] = [];
|
||||||
for (const method of grpcStreamMethods) {
|
for (const method of grpcStreamMethods) {
|
||||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||||
GrpcStreamMethod("LdapAuthService", method)(constructor.prototype[method], method, descriptor);
|
GrpcStreamMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LDAP_AUTH_SERVICE_NAME = "LdapAuthService";
|
export const RBAC_SERVICE_NAME = "RbacService";
|
||||||
|
|||||||
Reference in New Issue
Block a user