ldapclient

package
v0.0.0-...-52527b8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 59

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMaybeBind

func ConnectMaybeBind(clientConfig Config) (ldap.Client, error)

ConnectMaybeBind returns an ldap.Client with an active connection. It attempts to bind if bind credentials were provided and would fail if the bind fails.

The caller is responsible for closing the connection.

Types

type Config

type Config interface {
	Connect() (client ldap.Client, err error)
	GetBindCredentials() (bindDN, bindPassword string)
	Host() string
}

Config knows how to connect to an LDAP server and can describe which server it is connecting to

func NewLDAPClientConfig

func NewLDAPClientConfig(URL, bindDN, bindPassword, CA string, insecure bool) (Config, error)

NewLDAPClientConfig returns a new LDAP client config

Jump to

Keyboard shortcuts

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