ldap

package
v0.0.0-...-49281bb Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = time.Second * 3
)

Variables

View Source
var (
	AdAttributes       = []string{"sAMAccountName", "displayName", "mail", "mobile", "employeeID", "givenName"}
	OpenldapAttributes = []string{"cn", "mail", "displayName", "uid"}
)

Functions

This section is empty.

Types

type LDAP

type LDAP struct {
	Option *option
	Logger *logrus.Logger
}

func GetLdapApi

func GetLdapApi(Enable, Tls bool, Addr, BaseDN, ManagerDN, BindPass, AuthFilter string, logger *logrus.Logger) (*LDAP, error)

func NewLDAP

func NewLDAP() *LDAP

func (*LDAP) Authentication

func (a *LDAP) Authentication(username, password string) (Result, error)

func (*LDAP) Bind

func (a *LDAP) Bind(username, password string) error

func (*LDAP) Connect

func (a *LDAP) Connect() (*ldap.Conn, error)

func (*LDAP) GetGroupUsers

func (a *LDAP) GetGroupUsers(GroupName string, conn *ldap.Conn)

func (*LDAP) GetSearchRequest

func (a *LDAP) GetSearchRequest(username string) *ldap.SearchRequest

func (*LDAP) Group

func (a *LDAP) Group(name string, conn *ldap.Conn) (string, error)

func (*LDAP) RestPassword

func (a *LDAP) RestPassword(username, OldPassword, NewPassword string, change bool) error

func (*LDAP) User

func (a *LDAP) User(username string, conn *ldap.Conn) (*ldap.Entry, error)

type Result

type Result struct {
	DisplayName string `json:"displayname"`
	Username    string `json:"username"`
	Email       string `json:"email"`
	Phone       string `json:"phone"`
	EmployeeId  string `json:"employeeId"`
}

Jump to

Keyboard shortcuts

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