mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-12 11:59:18 +02:00
* Support for NTLM authentication added To support NTLM authentication, a database is added as an authentication source. Currently, only the configuration file is supported as a database. Database authentication supports Basic and NTLM authentication protcols. ServerConfig.BasicAuthEnabled renamed to LocalEnabled as Basic auth can be used with NTLM or Local.
137 lines
4.7 KiB
Go
137 lines
4.7 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package auth
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// AuthenticateClient is the client API for Authenticate 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 AuthenticateClient interface {
|
|
Authenticate(ctx context.Context, in *UserPass, opts ...grpc.CallOption) (*AuthResponse, error)
|
|
NTLM(ctx context.Context, in *NtlmRequest, opts ...grpc.CallOption) (*NtlmResponse, error)
|
|
}
|
|
|
|
type authenticateClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthenticateClient(cc grpc.ClientConnInterface) AuthenticateClient {
|
|
return &authenticateClient{cc}
|
|
}
|
|
|
|
func (c *authenticateClient) Authenticate(ctx context.Context, in *UserPass, opts ...grpc.CallOption) (*AuthResponse, error) {
|
|
out := new(AuthResponse)
|
|
err := c.cc.Invoke(ctx, "/auth.Authenticate/Authenticate", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authenticateClient) NTLM(ctx context.Context, in *NtlmRequest, opts ...grpc.CallOption) (*NtlmResponse, error) {
|
|
out := new(NtlmResponse)
|
|
err := c.cc.Invoke(ctx, "/auth.Authenticate/NTLM", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthenticateServer is the server API for Authenticate service.
|
|
// All implementations must embed UnimplementedAuthenticateServer
|
|
// for forward compatibility
|
|
type AuthenticateServer interface {
|
|
Authenticate(context.Context, *UserPass) (*AuthResponse, error)
|
|
NTLM(context.Context, *NtlmRequest) (*NtlmResponse, error)
|
|
mustEmbedUnimplementedAuthenticateServer()
|
|
}
|
|
|
|
// UnimplementedAuthenticateServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedAuthenticateServer struct {
|
|
}
|
|
|
|
func (UnimplementedAuthenticateServer) Authenticate(context.Context, *UserPass) (*AuthResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
|
|
}
|
|
func (UnimplementedAuthenticateServer) NTLM(context.Context, *NtlmRequest) (*NtlmResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method NTLM not implemented")
|
|
}
|
|
func (UnimplementedAuthenticateServer) mustEmbedUnimplementedAuthenticateServer() {}
|
|
|
|
// UnsafeAuthenticateServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthenticateServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthenticateServer interface {
|
|
mustEmbedUnimplementedAuthenticateServer()
|
|
}
|
|
|
|
func RegisterAuthenticateServer(s grpc.ServiceRegistrar, srv AuthenticateServer) {
|
|
s.RegisterService(&Authenticate_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Authenticate_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserPass)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticateServer).Authenticate(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/auth.Authenticate/Authenticate",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticateServer).Authenticate(ctx, req.(*UserPass))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Authenticate_NTLM_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(NtlmRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticateServer).NTLM(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/auth.Authenticate/NTLM",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticateServer).NTLM(ctx, req.(*NtlmRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Authenticate_ServiceDesc is the grpc.ServiceDesc for Authenticate service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Authenticate_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "auth.Authenticate",
|
|
HandlerType: (*AuthenticateServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Authenticate",
|
|
Handler: _Authenticate_Authenticate_Handler,
|
|
},
|
|
{
|
|
MethodName: "NTLM",
|
|
Handler: _Authenticate_NTLM_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "auth.proto",
|
|
}
|