ldap

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = "20060102150405Z"
	DateLayout = "20060102"

	DefaultPageSize = 100
	DefaultPoolSize = 10
)

Variables

View Source
var (
	ErrEmptyAddr = errors.New("ldap addr is empty")
	ErrEmptyBase = errors.New("ldap base is empty")
	ErrEmptyDN   = errors.New("ldap dn is empty")
	ErrEmptyPwd  = errors.New("ldap passwd is empty")
	ErrLogin     = errors.New("Incorrect Username/Password")
	ErrNotFound  = errors.New("Not Found")
	ErrUnsupport = errors.New("Unsupported")
)

Functions

func DN added in v0.7.0

func DN(pk, name, parent string) string

func NewEentryType added in v0.7.0

func NewEentryType(pk, oc string, attrs ...string) (et *entryType)

Types

type Config

type Config struct {
	Addr, Base   string
	Bind, Passwd string
	Domain       string
	PageSize     int
}

Config LDAP config

func NewConfig added in v0.8.9

func NewConfig() Config

NewConfig return default Config from Environment

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.Staffs)

func (*LDAPStore) AllGroup added in v0.6.3

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

func (*LDAPStore) Authenticate added in v0.6.3

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

Authenticate verify uid and password from one of sources, return valid DN and 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) EraseGroup added in v0.8.13

func (s *LDAPStore) EraseGroup(name string) error

func (*LDAPStore) Get added in v0.6.3

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

func (*LDAPStore) GetByDN added in v0.8.8

func (s *LDAPStore) GetByDN(dn 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) PoolStats added in v0.8.6

func (s *LDAPStore) PoolStats() *PoolStats

func (*LDAPStore) Ready added in v0.7.0

func (s *LDAPStore) Ready() 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

type PoolStats added in v0.8.5

type PoolStats = pool.Stats

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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