Documentation ¶
Index ¶
- Constants
- func GetDefaultAttributes() []string
- type Config
- type FuncLogger
- type HelperLDAP
- func (lc *HelperLDAP) AuthUser(username, password string) liberr.Error
- func (lc *HelperLDAP) Check() liberr.Error
- func (lc *HelperLDAP) Clone() *HelperLDAP
- func (lc *HelperLDAP) Close()
- func (lc *HelperLDAP) Connect() liberr.Error
- func (lc *HelperLDAP) ForceTLSMode(tlsMode TLSMode, tlsConfig *tls.Config)
- func (lc *HelperLDAP) GroupInfo(groupname string) (map[string]interface{}, liberr.Error)
- func (lc *HelperLDAP) GroupInfoByField(groupname string, fieldForUnicValue string) (map[string]interface{}, liberr.Error)
- func (lc *HelperLDAP) ParseEntries(entry string) map[string][]string
- func (lc *HelperLDAP) SetCredentials(user, pass string)
- func (lc *HelperLDAP) SetLogger(fct liblog.FuncLog)
- func (lc *HelperLDAP) UserInfo(username string) (map[string]string, liberr.Error)
- func (lc *HelperLDAP) UserInfoByField(username string, fieldOfUnicValue string) (map[string]string, liberr.Error)
- func (lc *HelperLDAP) UserIsInGroup(username string, groupname []string) (bool, liberr.Error)
- func (lc *HelperLDAP) UserMemberOf(username string) ([]string, liberr.Error)
- func (lc *HelperLDAP) UsersOfGroup(groupname string) ([]string, liberr.Error)
- type TLSMode
Constants ¶
const ( ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgLDAP ErrorLDAPContext ErrorLDAPServerConfig ErrorLDAPServerConnection ErrorLDAPServerDial ErrorLDAPServerDialClosing ErrorLDAPServerTLS ErrorLDAPServerStartTLS ErrorLDAPBind ErrorLDAPSearch ErrorLDAPUserNotUniq ErrorLDAPUserNotFound ErrorLDAPInvalidDN ErrorLDAPInvalidUID ErrorLDAPAttributeNotFound ErrorLDAPAttributeEmpty ErrorLDAPValidatorError ErrorLDAPGroupNotFound )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultAttributes ¶
func GetDefaultAttributes() []string
Types ¶
type Config ¶
type Config struct { Uri string `cloud:"uri" mapstructure:"uri" json:"uri" yaml:"uri" toml:"uri" validate:"fqdn,required"` PortLdap int `` /* 144-byte string literal not displayed */ Portldaps int `` /* 143-byte string literal not displayed */ Basedn string `cloud:"basedn" mapstructure:"basedn" json:"basedn" yaml:"basedn" toml:"basedn" validate:"printascii,omitempty"` //FilterGroup is fmt pattern like '(&(objectClass=groupOfNames)(%s=%s))' to make search of group object class FilterGroup string `` /* 139-byte string literal not displayed */ //FilterUser is a fmt pattern like '(%s=%s)' to make search of user. By default, uid field is 'uid' FilterUser string `` /* 134-byte string literal not displayed */ }
func (Config) PatternFilterGroup ¶
func (Config) PatternFilterUser ¶
func (Config) ServerAddr ¶
type FuncLogger ¶ added in v1.7.0
type HelperLDAP ¶
type HelperLDAP struct { Attributes []string // contains filtered or unexported fields }
HelperLDAP struct use to manage connection to server and request it.
func (*HelperLDAP) AuthUser ¶
func (lc *HelperLDAP) AuthUser(username, password string) liberr.Error
AuthUser used to test bind given user uid and password.
func (*HelperLDAP) Check ¶
func (lc *HelperLDAP) Check() liberr.Error
Check used to check if connection success (without any bind).
func (*HelperLDAP) Clone ¶ added in v1.13.1
func (lc *HelperLDAP) Clone() *HelperLDAP
func (*HelperLDAP) Connect ¶
func (lc *HelperLDAP) Connect() liberr.Error
Connect used to connect and bind to server.
func (*HelperLDAP) ForceTLSMode ¶
func (lc *HelperLDAP) ForceTLSMode(tlsMode TLSMode, tlsConfig *tls.Config)
ForceTLSMode used to force tls mode and defined tls condition.
func (*HelperLDAP) GroupInfo ¶ added in v1.3.0
func (lc *HelperLDAP) GroupInfo(groupname string) (map[string]interface{}, liberr.Error)
GroupInfo used to retrieve the information of a given group cn.
func (*HelperLDAP) GroupInfoByField ¶ added in v1.5.0
func (lc *HelperLDAP) GroupInfoByField(groupname string, fieldForUnicValue string) (map[string]interface{}, liberr.Error)
GroupInfoByField used to retrieve the information of a given group cn, but use a given field to make the search.
func (*HelperLDAP) ParseEntries ¶
func (lc *HelperLDAP) ParseEntries(entry string) map[string][]string
ParseEntries used to clean attributes of an object class.
func (*HelperLDAP) SetCredentials ¶
func (lc *HelperLDAP) SetCredentials(user, pass string)
SetCredentials used to defined the BindDN and password for connection.
func (*HelperLDAP) SetLogger ¶ added in v1.7.0
func (lc *HelperLDAP) SetLogger(fct liblog.FuncLog)
SetLogger is used to specify the logger to be used for debug messgae
func (*HelperLDAP) UserInfoByField ¶ added in v1.5.0
func (lc *HelperLDAP) UserInfoByField(username string, fieldOfUnicValue string) (map[string]string, liberr.Error)
UserInfoByField used to retrieve the information of a given username but use a given field to make the search.
func (*HelperLDAP) UserIsInGroup ¶
UserIsInGroup used to check if a given username is a group member of a list of reference group name.
func (*HelperLDAP) UserMemberOf ¶
func (lc *HelperLDAP) UserMemberOf(username string) ([]string, liberr.Error)
UserMemberOf returns the group list of a given user.
func (*HelperLDAP) UsersOfGroup ¶
func (lc *HelperLDAP) UsersOfGroup(groupname string) ([]string, liberr.Error)
UsersOfGroup used to retrieve the member list of a given group name.