ldapsession

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainInfo

type DomainInfo struct {
	Metadata                           *ldap.SearchResult
	DomainFunctionalityLevel           string
	ForestFunctionalityLevel           string
	DomainControllerFunctionalityLevel string
	ServerDNSName                      string
}

type LDAPSession

type LDAPSession struct {
	LConn      *ldap.Conn
	PageSize   uint32
	BaseDN     string
	DomainInfo DomainInfo
	Log        *logrus.Entry

	Channels *ResultChannels
	// contains filtered or unexported fields
}

func NewLDAPSession

func NewLDAPSession(options *LDAPSessionOptions, ctx context.Context) (sess *LDAPSession, err error)

func (*LDAPSession) Close

func (w *LDAPSession) Close()

func (*LDAPSession) CloseChannels

func (w *LDAPSession) CloseChannels()

func (*LDAPSession) ExecuteSearchRequest

func (w *LDAPSession) ExecuteSearchRequest(searchRequest *ldap.SearchRequest) error

ExecuteSearchRequest performs a paged search and writes results to the LDAPsession's defined results channel. it only returns an err

func (*LDAPSession) GetDefaultNamingContext

func (w *LDAPSession) GetDefaultNamingContext() (string, error)

func (*LDAPSession) GetPagedSearchResults

func (w *LDAPSession) GetPagedSearchResults(request *ldap.SearchRequest) (result *ldap.SearchResult, err error)

GetPagedSearchResults is a synchronous operation that will populate and return an ldap.SearchResult object

func (*LDAPSession) GetSearchResults

func (w *LDAPSession) GetSearchResults(request *ldap.SearchRequest) (result *ldap.SearchResult, err error)

func (*LDAPSession) MakeSimpleSearchRequest

func (w *LDAPSession) MakeSimpleSearchRequest(filter string, attrs []string) *ldap.SearchRequest

func (*LDAPSession) ManualWriteSearchResultsToChan

func (w *LDAPSession) ManualWriteSearchResultsToChan(results *ldap.SearchResult)

func (*LDAPSession) NTLMBind

func (w *LDAPSession) NTLMBind(username, password, hash string) (err error)

func (*LDAPSession) NewChannels

func (w *LDAPSession) NewChannels(ctx context.Context)

func (*LDAPSession) ReturnMetadataResults

func (w *LDAPSession) ReturnMetadataResults() error

func (*LDAPSession) SetChannels

func (w *LDAPSession) SetChannels(chs *ResultChannels, ctx context.Context)

func (*LDAPSession) SimpleBind

func (w *LDAPSession) SimpleBind(username, password string) (err error)

type LDAPSessionOptions

type LDAPSessionOptions struct {
	Domain           string
	DomainController string
	Username         string
	Password         string
	Hash             string
	UseNTLM          bool
	Port             int
	Secure           bool
	Proxy            string
	PageSize         int
	Logger           *logrus.Logger
}

type ResultChannels

type ResultChannels struct {
	Entries   chan *ldap.Entry
	Referrals chan string
	Controls  chan ldap.Control
}

Jump to

Keyboard shortcuts

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