ldap

package
v0.0.0-...-fa598d4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conn *ldap.Conn

Functions

func ConnectLdap

func ConnectLdap()

func Setup

func Setup()

Types

type Attribute

type Attribute struct {
	Type string
	Vals []string
}

type LDAP_CONFIG

type LDAP_CONFIG struct {
	Addr       string   `json:"addr"`
	BaseDn     string   `json:"baseDn"`
	UserDn     string   `json:"userDn"`
	BindDn     string   `json:"bindDn`
	BindPass   string   `json:"bindPass"`
	AuthFilter string   `json:"authFilter"`
	Attributes []string `json:"attributes"`
	TLS        bool     `json:"tls"`
	StartTLS   bool     `json:"startTLS"`
}

func GetLdap

func GetLdap() LDAP_CONFIG

func (*LDAP_CONFIG) Add

func (lc *LDAP_CONFIG) Add(username, mail, uidNumber, gidNumber, password string) error

func (*LDAP_CONFIG) Auth

func (lc *LDAP_CONFIG) Auth(username, password string) (success bool, err error)

func (*LDAP_CONFIG) Close

func (lc *LDAP_CONFIG) Close()

func (*LDAP_CONFIG) Connect

func (lc *LDAP_CONFIG) Connect() (err error)

func (*LDAP_CONFIG) Search

func (lc *LDAP_CONFIG) Search(SearchFilter string) (results []LDAP_RESULT, err error)

func (*LDAP_CONFIG) Search_User

func (lc *LDAP_CONFIG) Search_User(username string) (user LDAP_RESULT, err error)

type LDAP_RESULT

type LDAP_RESULT struct {
	DN         string              `json:"dn"`
	Attributes map[string][]string `json:"attributes"`
}

Jump to

Keyboard shortcuts

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