ldap

package module
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 7 Imported by: 0

README

ldap-client

just another little ldap-client package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LdapConfig

type LdapConfig struct {
	Conn         *ldap.Conn
	Host         string `validate:"required,ipv4|ipv6|hostname|fqdn"`
	Port         int    `validate:"required,number,min=1,max=65535"`
	BindUser     string `validate:"required,printascii,excludesall=!?*%&/\()[]{}$#<>.,"`
	BindPassword string `validate:"required,printascii,max=50"`
	BaseDN       string `validate:"required,printascii,excludesall=!?*%&/\()[]{}$#<>.,"`
	ServerName   string `validate:"required,ipv4|ipv6|hostname|fqdn"`
	Attributes   string `validate:"required,printascii,excludesall=!?*%&/\()[]{}$#<>."`
}

LdapConfig will hold the config which are needed to connect and search

func (*LdapConfig) Authenticate

func (lc *LdapConfig) Authenticate(username, password string) (map[string]string, error)

Authenticate will bind, search for a user and authenticate

func (*LdapConfig) CheckGroupMembership

func (lc *LdapConfig) CheckGroupMembership(username, group string) (bool, error)

CheckGroupMembership will check if a given user is member of a given group

func (*LdapConfig) Close

func (lc *LdapConfig) Close()

Close will close the LDAP connection

Source Files

Jump to

Keyboard shortcuts

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