ldaputils

package
v0.3.9-2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound      = errors.New("not found")
	ErrUserDuplicate     = errors.New("user id duplicate")
	ErrUserBadCredential = errors.New("bad credential")
)

Functions

func GetAttributeValue

func GetAttributeValue(e *ldap.Entry, key string) string

func GetAttributeValues

func GetAttributeValues(e *ldap.Entry, key string) []string

Types

type SLDAPClient

type SLDAPClient struct {
	// contains filtered or unexported fields
}

func NewLDAPClient

func NewLDAPClient(url, account, password string, baseDN string, isDebug bool) *SLDAPClient

func (*SLDAPClient) Authenticate

func (cli *SLDAPClient) Authenticate(baseDN string, objClass string, uidAttr string, uname string, passwd string, filter string, fields []string, queryScope int) (*ldap.Entry, error)

func (*SLDAPClient) Close

func (cli *SLDAPClient) Close()

func (*SLDAPClient) Connect

func (cli *SLDAPClient) Connect() error

func (*SLDAPClient) Search

func (cli *SLDAPClient) Search(base string, objClass string, condition map[string]string, filter string, fields []string, queryScope int) ([]*ldap.Entry, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL