ldap

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyAddr = errors.New("ldap addr is empty")
	ErrEmptyBase = errors.New("ldap base is empty")
	ErrLogin     = errors.New("049: Invalid Username/Password")
	ErrNotFound  = errors.New("Not Found")
)

Functions

func NewSource

func NewSource(cfg *Config) (*ldapSource, error)

Add a new source (LDAP directory) to the global pool

Types

type Config

type Config struct {
	Addr, Base   string
	Bind, Passwd string
	Filter       string
	Attributes   []string
}

LDAP config

type LDAPStore added in v0.6.3

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

func NewStore

func NewStore(cfg *Config) (*LDAPStore, error)

func (*LDAPStore) All added in v0.6.3

func (s *LDAPStore) All() (staffs []*models.Staff)

func (*LDAPStore) AllGroup added in v0.6.3

func (s *LDAPStore) AllGroup() (data []models.Group)

func (*LDAPStore) Authenticate added in v0.6.3

func (s *LDAPStore) Authenticate(uid, passwd string) (err error)

func (*LDAPStore) Close added in v0.6.3

func (s *LDAPStore) Close()

func (*LDAPStore) Delete added in v0.6.3

func (s *LDAPStore) Delete(uid string) (err error)

func (*LDAPStore) Get added in v0.6.3

func (s *LDAPStore) Get(uid string) (staff *models.Staff, err error)

func (*LDAPStore) GetGroup added in v0.6.3

func (s *LDAPStore) GetGroup(name string) (group *models.Group, err error)

func (*LDAPStore) ModifyBySelf added in v0.6.3

func (s *LDAPStore) ModifyBySelf(uid, password string, staff *models.Staff) (err error)

func (*LDAPStore) PasswordChange added in v0.6.3

func (s *LDAPStore) PasswordChange(uid, oldPasswd, newPasswd string) (err error)

func (*LDAPStore) PasswordReset added in v0.6.3

func (s *LDAPStore) PasswordReset(uid, passwd string) (err error)

func (*LDAPStore) Save added in v0.6.3

func (s *LDAPStore) Save(staff *models.Staff) (isNew bool, err error)

func (*LDAPStore) SaveGroup added in v0.6.3

func (s *LDAPStore) SaveGroup(group *models.Group) error

Jump to

Keyboard shortcuts

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