ldap

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint string `json:"ldap_address"`
	Port     string `json:"ldap_port"`
	UserName string `json:"ldap_username"`
	UserDn   string `json:"ldap_dn"`
	Password string `json:"ldap_password"`
	Filter   string `json:"ldap_filter"`
	Mapping  string `json:"ldap_mapping"`
	TLS      string `json:"ldap_tls"`
}

func (*Config) GetAttributes

func (c *Config) GetAttributes() ([]string, error)

func (*Config) GetMappings

func (c *Config) GetMappings() (map[string]string, error)

type LdapClient

type LdapClient struct {
	Vars   map[string]string
	Config Config
	Conn   *ldap.Conn
}

func NewLdap

func NewLdap(vars map[string]string) (*LdapClient, error)

func (*LdapClient) Connect

func (l *LdapClient) Connect() error

func (*LdapClient) Login

func (l *LdapClient) Login(username, password string) error

func (*LdapClient) Search

func (l *LdapClient) Search(dn, filter string, sizeLimit, timeLimit int, attributes []string) ([]*ldap.Entry, error)

Jump to

Keyboard shortcuts

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