2020-08-21 02:03:53 -05:00
|
|
|
package ldap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/hashicorp/go-hclog"
|
|
|
|
ldap "github.com/ps78674/ldapserver"
|
2020-08-23 02:14:41 -05:00
|
|
|
|
|
|
|
pb "github.com/netauth/protocol"
|
2020-08-21 02:03:53 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type naClient interface {
|
|
|
|
AuthEntity(context.Context, string, string) error
|
2020-08-23 02:14:41 -05:00
|
|
|
EntitySearch(context.Context, string) ([]*pb.Entity, error)
|
|
|
|
EntityGroups(context.Context, string) ([]*pb.Group, error)
|
2020-08-23 02:50:43 -05:00
|
|
|
|
|
|
|
GroupSearch(context.Context, string) ([]*pb.Group, error)
|
|
|
|
GroupMembers(context.Context, string) ([]*pb.Entity, error)
|
2020-08-21 02:03:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type server struct {
|
|
|
|
*ldap.Server
|
|
|
|
|
2020-08-23 02:14:41 -05:00
|
|
|
routes *ldap.RouteMux
|
|
|
|
|
2020-08-21 02:03:53 -05:00
|
|
|
c naClient
|
|
|
|
l hclog.Logger
|
2020-08-22 22:49:54 -05:00
|
|
|
|
|
|
|
nc []string
|
2022-08-27 17:35:45 -05:00
|
|
|
|
|
|
|
allowAnon bool
|
2020-08-21 02:03:53 -05:00
|
|
|
}
|