Documentation
¶
Index ¶
- Constants
- func MaybeDecode(value string) string
- type Handler
- type HandlerWrapper
- type HelperMaker
- type LDAPOpsHandler
- type LDAPOpsHelper
- type OCSGroupsResponse
- type OCSUsersResponse
- type Option
- func Backend(val config.Backend) Option
- func Config(val *config.Config) Option
- func Context(val *context.Context) Option
- func Handlers(val HandlerWrapper) Option
- func Helper(val Handler) Option
- func LDAPHelper(val LDAPOpsHelper) Option
- func Logger(val *zap.Logger) Option
- func YubiAuth(val *yubigo.YubiAuth) Option
- type Options
Constants ¶
const ( Down ldapBackendStatus = iota Up )
Variables ¶
This section is empty.
Functions ¶
func MaybeDecode ¶
Types ¶
type Handler ¶
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 }
Handler is the common interface for all datastores
func NewConfigHandler ¶
NewConfigHandler creates a new config backed handler
func NewLdapHandler ¶
func NewOwnCloudHandler ¶
type HandlerWrapper ¶
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 HelperMaker ¶
type LDAPOpsHandler ¶
type LDAPOpsHandler interface { GetBackend() config.Backend GetLog() *zap.Logger GetCfg() *config.Config GetYubikeyAuth() *yubigo.YubiAuth FindUser(userName string, searchByUPN bool) (f bool, u config.User, err error) FindGroup(groupName string) (f bool, g config.Group, err error) FindPosixAccounts(hierarchy string) (entrylist []*ldap.Entry, err error) FindPosixGroups(hierarchy string) (entrylist []*ldap.Entry, err error) }
type LDAPOpsHelper ¶
type LDAPOpsHelper struct {
// contains filtered or unexported fields
}
func NewLDAPOpsHelper ¶
func NewLDAPOpsHelper() LDAPOpsHelper
func (LDAPOpsHelper) Bind ¶
func (l LDAPOpsHelper) Bind(h LDAPOpsHandler, bindDN, bindSimplePw string, conn net.Conn) (resultCode ldap.LDAPResultCode, err error)
func (LDAPOpsHelper) Search ¶
func (l LDAPOpsHelper) Search(h LDAPOpsHandler, bindDN string, searchReq ldap.SearchRequest, conn net.Conn) (result ldap.ServerSearchResult, err error)
* TODO #1: * Is it possible to map, on-the-fly, ou= -> cn= to maintain backware compatibility? Could be a switch... * Or maybe sinmply configure in the .cfg file using the nameformat and groupformat settings? * In 3.0 we could change default from cn to ou * TODO #2: DONE * Returns values when scope==base or scope==sub on a group entry * TODO #3: DONE * Make sure that when scope==sub, we do not always return, but augment results instead * TODO #4: DONE * Handle groups as two distinct objectclasses like OLDAP does * Q: Does OLDAP return the groups twice when querying root+sub? * TODO #5: * Document roll out of schemas
type OCSGroupsResponse ¶
type OCSUsersResponse ¶
type Option ¶
type Option func(o *Options)
Option defines a single option function.
type Options ¶
type Options struct { Backend config.Backend Handlers HandlerWrapper Logger *zap.Logger Config *config.Config Context *context.Context YubiAuth *yubigo.YubiAuth Helper Handler LDAPHelper LDAPOpsHelper }
Options defines the available options for this package.
func NewOptions ¶
newOptions initializes the available default options.