chore: auto-generate protobuf files [skip ci]
This commit is contained in:
@@ -19,14 +19,37 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
LdapAuth_VerifyUser_FullMethodName = "/ldap_service.LdapAuth/VerifyUser"
|
||||
LdapAuth_VerifyUser_FullMethodName = "/ldap_service.LdapAuth/VerifyUser"
|
||||
LdapAuth_GetUsers_FullMethodName = "/ldap_service.LdapAuth/GetUsers"
|
||||
LdapAuth_CreateUser_FullMethodName = "/ldap_service.LdapAuth/CreateUser"
|
||||
LdapAuth_UpdateUser_FullMethodName = "/ldap_service.LdapAuth/UpdateUser"
|
||||
LdapAuth_ChangePassword_FullMethodName = "/ldap_service.LdapAuth/ChangePassword"
|
||||
LdapAuth_ToggleUserStatus_FullMethodName = "/ldap_service.LdapAuth/ToggleUserStatus"
|
||||
LdapAuth_GetGroups_FullMethodName = "/ldap_service.LdapAuth/GetGroups"
|
||||
LdapAuth_AddUserToGroup_FullMethodName = "/ldap_service.LdapAuth/AddUserToGroup"
|
||||
LdapAuth_RemoveUserFromGroup_FullMethodName = "/ldap_service.LdapAuth/RemoveUserFromGroup"
|
||||
)
|
||||
|
||||
// LdapAuthClient is the client API for LdapAuth service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// ==========================================
|
||||
// ГЛАВНЫЙ СЕРВИС
|
||||
// ==========================================
|
||||
type LdapAuthClient interface {
|
||||
// --- Вектор 1: Авторизация (Bind от имени пользователя) ---
|
||||
VerifyUser(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*VerifyResponse, error)
|
||||
// --- Вектор 2: Управление Пользователями (Bind системного аккаунта) ---
|
||||
GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
// --- Вектор 3: Управление Группами ---
|
||||
GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error)
|
||||
AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||
}
|
||||
|
||||
type ldapAuthClient struct {
|
||||
@@ -47,11 +70,106 @@ func (c *ldapAuthClient) VerifyUser(ctx context.Context, in *VerifyRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) GetUsers(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*UserListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UserListResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_GetUsers_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_CreateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_UpdateUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_ChangePassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) ToggleUserStatus(ctx context.Context, in *ToggleStatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_ToggleUserStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) GetGroups(ctx context.Context, in *EmptyRequest, opts ...grpc.CallOption) (*GroupListResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GroupListResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_GetGroups_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) AddUserToGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_AddUserToGroup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *ldapAuthClient) RemoveUserFromGroup(ctx context.Context, in *GroupMemberRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(StatusResponse)
|
||||
err := c.cc.Invoke(ctx, LdapAuth_RemoveUserFromGroup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// LdapAuthServer is the server API for LdapAuth service.
|
||||
// All implementations must embed UnimplementedLdapAuthServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// ==========================================
|
||||
// ГЛАВНЫЙ СЕРВИС
|
||||
// ==========================================
|
||||
type LdapAuthServer interface {
|
||||
// --- Вектор 1: Авторизация (Bind от имени пользователя) ---
|
||||
VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error)
|
||||
// --- Вектор 2: Управление Пользователями (Bind системного аккаунта) ---
|
||||
GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error)
|
||||
CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error)
|
||||
UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error)
|
||||
ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error)
|
||||
ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error)
|
||||
// --- Вектор 3: Управление Группами ---
|
||||
GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error)
|
||||
AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error)
|
||||
RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error)
|
||||
mustEmbedUnimplementedLdapAuthServer()
|
||||
}
|
||||
|
||||
@@ -65,6 +183,30 @@ type UnimplementedLdapAuthServer struct{}
|
||||
func (UnimplementedLdapAuthServer) VerifyUser(context.Context, *VerifyRequest) (*VerifyResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method VerifyUser not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) GetUsers(context.Context, *EmptyRequest) (*UserListResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUsers not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) CreateUser(context.Context, *CreateUserRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) UpdateUser(context.Context, *UpdateUserRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) ChangePassword(context.Context, *ChangePasswordRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ChangePassword not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) ToggleUserStatus(context.Context, *ToggleStatusRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ToggleUserStatus not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) GetGroups(context.Context, *EmptyRequest) (*GroupListResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetGroups not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) AddUserToGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method AddUserToGroup not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) RemoveUserFromGroup(context.Context, *GroupMemberRequest) (*StatusResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method RemoveUserFromGroup not implemented")
|
||||
}
|
||||
func (UnimplementedLdapAuthServer) mustEmbedUnimplementedLdapAuthServer() {}
|
||||
func (UnimplementedLdapAuthServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -104,6 +246,150 @@ func _LdapAuth_VerifyUser_Handler(srv interface{}, ctx context.Context, dec func
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmptyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).GetUsers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_GetUsers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).GetUsers(ctx, req.(*EmptyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).CreateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_CreateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).CreateUser(ctx, req.(*CreateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).UpdateUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_UpdateUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).UpdateUser(ctx, req.(*UpdateUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChangePasswordRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).ChangePassword(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_ChangePassword_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_ToggleUserStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ToggleStatusRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).ToggleUserStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_ToggleUserStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).ToggleUserStatus(ctx, req.(*ToggleStatusRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmptyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).GetGroups(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_GetGroups_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).GetGroups(ctx, req.(*EmptyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_AddUserToGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GroupMemberRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).AddUserToGroup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_AddUserToGroup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).AddUserToGroup(ctx, req.(*GroupMemberRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LdapAuth_RemoveUserFromGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GroupMemberRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LdapAuthServer).RemoveUserFromGroup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: LdapAuth_RemoveUserFromGroup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LdapAuthServer).RemoveUserFromGroup(ctx, req.(*GroupMemberRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// LdapAuth_ServiceDesc is the grpc.ServiceDesc for LdapAuth service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -115,6 +401,38 @@ var LdapAuth_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "VerifyUser",
|
||||
Handler: _LdapAuth_VerifyUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUsers",
|
||||
Handler: _LdapAuth_GetUsers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateUser",
|
||||
Handler: _LdapAuth_CreateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateUser",
|
||||
Handler: _LdapAuth_UpdateUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChangePassword",
|
||||
Handler: _LdapAuth_ChangePassword_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ToggleUserStatus",
|
||||
Handler: _LdapAuth_ToggleUserStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetGroups",
|
||||
Handler: _LdapAuth_GetGroups_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddUserToGroup",
|
||||
Handler: _LdapAuth_AddUserToGroup_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemoveUserFromGroup",
|
||||
Handler: _LdapAuth_RemoveUserFromGroup_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "ldap.proto",
|
||||
|
||||
Reference in New Issue
Block a user