ldap

package
v1.8.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDNSyntax = errors.New("Invalid DN syntax")

ErrDNSyntax ...

View Source
var ErrNotFound = errors.New("entity not found")

ErrNotFound ...

Functions

func ConnectionTestWithAllConfig added in v1.6.0

func ConnectionTestWithAllConfig(ldapConfig models.LdapConf, ldapGroupConfig models.LdapGroupConf) error

ConnectionTestWithAllConfig - test ldap session connection, out of the scope of normal session create/close

func ConnectionTestWithConfig

func ConnectionTestWithConfig(ldapConfig models.LdapConf) error

ConnectionTestWithConfig -

Types

type Session

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

Session - define a LDAP session

func CreateWithAllConfig added in v1.6.0

func CreateWithAllConfig(ldapConf models.LdapConf, ldapGroupConfig models.LdapGroupConf) (*Session, error)

CreateWithAllConfig - create a Session with internal config

func CreateWithConfig

func CreateWithConfig(ldapConf models.LdapConf) (*Session, error)

CreateWithConfig -

func LoadSystemLdapConfig

func LoadSystemLdapConfig() (*Session, error)

LoadSystemLdapConfig - load LDAP configure

func (*Session) Bind

func (session *Session) Bind(dn string, password string) error

Bind with specified DN and password, used in authentication

func (*Session) Close

func (session *Session) Close()

Close - close current session

func (*Session) ConnectionTest

func (session *Session) ConnectionTest() error

ConnectionTest - test ldap session connection with system default setting

func (*Session) Open

func (session *Session) Open() error

Open - open Session

func (*Session) SearchGroupByDN added in v1.5.0

func (session *Session) SearchGroupByDN(groupDN string) ([]models.LdapGroup, error)

SearchGroupByDN ...

func (*Session) SearchGroupByName added in v1.5.0

func (session *Session) SearchGroupByName(groupName string) ([]models.LdapGroup, error)

SearchGroupByName ...

func (*Session) SearchLdap

func (session *Session) SearchLdap(filter string) (*goldap.SearchResult, error)

SearchLdap to search ldap with the provide filter

func (*Session) SearchLdapAttribute added in v1.5.0

func (session *Session) SearchLdapAttribute(baseDN, filter string, attributes []string) (*goldap.SearchResult, error)

SearchLdapAttribute - to search ldap with the provide filter, with specified attributes

func (*Session) SearchUser

func (session *Session) SearchUser(username string) ([]models.LdapUser, error)

SearchUser - search LDAP user by name

Jump to

Keyboard shortcuts

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