Documentation
¶
Index ¶
- Constants
- func GetDefaultAttributes() []string
- func IsCodeError() bool
- func SetTimeout(dialerTimeout, dialerKeepAlive time.Duration)
- type Config
- type HelperLDAP
- func (lc *HelperLDAP) AuthUser(username, password string) errors.Error
- func (lc *HelperLDAP) Check() errors.Error
- func (lc *HelperLDAP) Close()
- func (lc *HelperLDAP) Connect() errors.Error
- func (lc *HelperLDAP) ForceTLSMode(tlsMode TLSMode, tlsConfig *tls.Config)
- func (lc *HelperLDAP) GroupInfo(groupname string) (map[string]interface{}, errors.Error)
- func (lc HelperLDAP) ParseEntries(entry string) map[string][]string
- func (lc *HelperLDAP) SetCredentials(user, pass string)
- func (lc *HelperLDAP) UserInfo(username string) (map[string]string, errors.Error)
- func (lc *HelperLDAP) UserIsInGroup(username string, groupname []string) (bool, errors.Error)
- func (lc *HelperLDAP) UserMemberOf(username string) ([]string, errors.Error)
- func (lc *HelperLDAP) UsersOfGroup(groupname string) ([]string, errors.Error)
- type TLSMode
Constants ¶
const ( ErrorEmptyParams errors.CodeError = iota + errors.MIN_PKG_LDAP 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
func IsCodeError ¶
func IsCodeError() bool
func SetTimeout ¶ added in v1.3.0
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 string `` /* 139-byte string literal not displayed */ FilterUser string `` /* 134-byte string literal not displayed */ }
func (Config) PatternFilterGroup ¶
func (Config) PatternFilterUser ¶
func (Config) ServerAddr ¶
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) errors.Error
AuthUser used to test bind given user uid and password.
func (*HelperLDAP) Check ¶
func (lc *HelperLDAP) Check() errors.Error
Check used to check if connection success (without any bind).
func (*HelperLDAP) Connect ¶
func (lc *HelperLDAP) Connect() errors.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{}, errors.Error)
GroupInfo used to retrieve the information of a given group cn.
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) 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, errors.Error)
UserMemberOf returns the group list of a given user.
func (*HelperLDAP) UsersOfGroup ¶
func (lc *HelperLDAP) UsersOfGroup(groupname string) ([]string, errors.Error)
UsersOfGroup used to retrieve the member list of a given group name.