Files
glauth/pkg/handler/handler.go
T
Chris F Ravenscroft 4cf38893ac Introducing goconvey testing and refactoring of config and ... (#204)
* Introducing goconvey testing and refactoring of config and plugin backends.

* gofmt, oops

* Refactored re-insertion of requested attributes
2021-08-10 20:48:14 -07:00

36 lines
811 B
Go

package handler
import (
"github.com/glauth/glauth/pkg/config"
"github.com/nmcclain/ldap"
)
type HelperMaker interface {
FindUser(userName string) (bool, config.User, error)
FindGroup(groupName string) (bool, config.Group, error)
}
// Handler is the common interface for all datastores
type Handler interface {
// read support
ldap.Binder
ldap.Searcher
ldap.Closer
// write support
ldap.Adder
ldap.Modifier // Note: modifying eg the uid or cn might change the dn because the hierarchy is determined by the backend
ldap.Deleter
// helper
HelperMaker
}
// TODO When I grow up, I want to handle pointers same as I would in C
// and not need a counter because I would not allocate statically
// but use idiomatic slicing instead
type HandlerWrapper struct {
Handlers []Handler
Count *int
}