Documentation
¶
Index ¶
- type Config
- type Connection
- type ConnectionImpl
- func (lc *ConnectionImpl) Bind(username, password string) error
- func (lc *ConnectionImpl) Close()
- func (lc *ConnectionImpl) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
- func (lc *ConnectionImpl) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
- type LdapProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Url string `mapstructure:"url" json:"url,omitempty"`
BaseDN string `mapstructure:"base_dn" json:"base_dn,omitempty"`
BindDN string `mapstructure:"bind_dn" json:"bind_dn,omitempty"`
BindPassword string `mapstructure:"bind_password" json:"bind_password,omitempty"`
UsernameAttribute string `mapstructure:"username_attribute" json:"username_attribute,omitempty"`
MailAttribute string `mapstructure:"mail_attribute" json:"mail_attribute,omitempty"`
DisplayNameAttribute string `mapstructure:"display_name_attribute" json:"display_name_attribute,omitempty"`
TitleAttribute string `mapstructure:"title_attribute" json:"title_attribute,omitempty"`
WhenCreatedAttribute string `mapstructure:"when_created_attribute" json:"when_created_attribute,omitempty"`
UserFilter string `mapstructure:"user_filter" json:"user_filter,omitempty"`
SyncUserFilter string `mapstructure:"sync_user_filter" json:"sync_user_filter,omitempty"`
SyncExcludeOu string `mapstructure:"sync_exclude_ou" json:"sync_exclude_ou,omitempty"`
GroupFilter string `mapstructure:"group_filter" json:"group_filter"`
GroupNameAttribute string `mapstructure:"group_name_attribute" json:"group_name_attribute"`
}
type Connection ¶
type Connection interface {
Bind(username, password string) error
Close()
Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
}
type ConnectionImpl ¶
type ConnectionImpl struct {
// contains filtered or unexported fields
}
func NewLDAPConnectionImpl ¶
func NewLDAPConnectionImpl(conn *ldap.Conn) *ConnectionImpl
func (*ConnectionImpl) Bind ¶
func (lc *ConnectionImpl) Bind(username, password string) error
func (*ConnectionImpl) Close ¶
func (lc *ConnectionImpl) Close()
func (*ConnectionImpl) Search ¶
func (lc *ConnectionImpl) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
func (*ConnectionImpl) SearchWithPaging ¶
func (lc *ConnectionImpl) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
type LdapProvider ¶
type LdapProvider interface {
CheckConnect() error
VerifyUserCredentials(username string, password string) (domain.Profile, error)
FindUserDetail(username string) (domain.Profile, error)
SearchUserWithPaging() ([]domain.Profile, error)
}
func NewLdap ¶
func NewLdap(conf Config) LdapProvider
Click to show internal directories.
Click to hide internal directories.