Documentation
¶
Overview ¶
Package ldap provides a simple ldap client to authenticate, retrieve basic information and groups for a user.
Index ¶
- type LDAPClient
- func (lc *LDAPClient) AddUserAttribute(username string, attribute string, value string) (string, error)
- func (lc *LDAPClient) Authenticate(username, password string) (bool, map[string]string, error)
- func (lc *LDAPClient) Close()
- func (lc *LDAPClient) Connect() error
- func (lc *LDAPClient) GetPolicyAttribute(parameter string, attribute string) (string, error)
- func (lc *LDAPClient) GetUserAttribute(username string, attribute string) (string, error)
- func (lc *LDAPClient) GetUserGroups(username string) ([]string, error)
- func (lc *LDAPClient) SetUserAttribute(username string, attribute string, newValue string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LDAPClient ¶
type LDAPClient struct {
Attributes []string
Base string
BindDN string
BindPassword string
PolicyBase string
GroupFilter string // e.g. "(memberUid=%s)"
Host string
ServerName string
UserFilter string // e.g. "(uid=%s)"
Conn *ldap.Conn
Port int
InsecureSkipVerify bool
UseSSL bool
SkipTLS bool
ClientCertificates []tls.Certificate // Adding client certificates
}
func (*LDAPClient) AddUserAttribute ¶
func (*LDAPClient) Authenticate ¶
Authenticate authenticates the user against the ldap backend.
func (*LDAPClient) Connect ¶
func (lc *LDAPClient) Connect() error
Connect connects to the ldap backend.
func (*LDAPClient) GetPolicyAttribute ¶
func (lc *LDAPClient) GetPolicyAttribute(parameter string, attribute string) (string, error)
GetUserAttribute returns user specified attribute.
func (*LDAPClient) GetUserAttribute ¶
func (lc *LDAPClient) GetUserAttribute(username string, attribute string) (string, error)
GetUserAttribute returns user specified attribute.
func (*LDAPClient) GetUserGroups ¶
func (lc *LDAPClient) GetUserGroups(username string) ([]string, error)
GetGroupsOfUser returns the group for a user.
func (*LDAPClient) SetUserAttribute ¶
func (lc *LDAPClient) SetUserAttribute(username string, attribute string, newValue string) (string, error)
SetUserAttribute returns true if modification has been made successfully
Click to show internal directories.
Click to hide internal directories.