Documentation ¶
Index ¶
Constants ¶
const ServiceName = "ldap"
ServiceName defines the name of ldap service used for dependency injection
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IService ¶
type IService interface { gousu.IService Reconnect() error SimpleLogin(username string, password string, attributes []string) (*map[string][]string, error) }
IService defines all public functions of the ldap service
type MockService ¶
type MockService struct { gousu.MockService SimpleLoginFunc func(username string, password string, attributes []string) (*map[string][]string, error) ReconnectFunc func() error SimpleLoginFuncCalled int ReconnectFuncCalled int }
MockService for simply mocking ldap IService
func NewMockService ¶
func NewMockService() *MockService
NewMockService creates a new initialized instance of MockService
func (*MockService) Reconnect ¶
func (s *MockService) Reconnect() error
Reconnect calls ReconnectFunc and increases ReconnectFuncCalled
func (*MockService) SimpleLogin ¶
func (s *MockService) SimpleLogin(username string, password string, attributes []string) (*map[string][]string, error)
SimpleLogin calls SimpleLoginFunc and increases SimpleLoginFuncCalled
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the basic struct for the ldap service
func (*Service) Health ¶
Health checks if the ldap connection is healthy by executing a bind against ldap If the connectuing is not healthy a reconnect is triggered
func (*Service) SimpleLogin ¶
func (s *Service) SimpleLogin(username string, password string, attributes []string) (*map[string][]string, error)
SimpleLogin check a user against ldap and executes a bind with it's credentials
All attributes requested are returned for the matching user, else an error is returned