Back to

package ldaputils

Latest Go to latest
Published: Feb 26, 2020 | License: Apache-2.0 | Module:


Package ldaputils contains helpers to deal with LDAP.



const (
	LDAPAddressKey              = "address"
	LDAPBindDNKey               = "bindDN"
	LDAPBindPasswordKey         = "bindPassword"
	LDAPBindSearchFilterKey     = "bindSearchFilter"
	LDAPSubjectKey              = "subjectKey"
	LDAPIgnoredKeys             = "ignoredKeys"
	LDAPConnSecurityProtocolKey = "connSecurityProtocol"
	LDAPUsernameKey             = "username"
	LDAPPasswordKey             = "password"
	LDAPBaseDNKey               = "baseDN"

LDAP Key constant definitions.

type LDAPInfo

type LDAPInfo struct {
	Address              string                 `msgpack:"address" json:"address"`
	BindDN               string                 `msgpack:"bindDN" json:"bindDN"`
	BindPassword         string                 `msgpack:"bindPassword" json:"bindPassword"`
	BindSearchFilter     string                 `msgpack:"bindSearchFilter" json:"bindSearchFilter"`
	SubjectKey           string                 `msgpack:"subjectKey" json:"subjectKey"`
	IgnoreKeys           map[string]interface{} `msgpack:"ignoredKeys" json:"ignoredKeys"`
	BaseDN               string                 `msgpack:"baseDN" json:"baseDN"`
	ConnSecurityProtocol string                 `msgpack:"connSecurityProtocol" json:"connSecurityProtocol"`
	Username             string                 `msgpack:"username" json:"username"`
	Password             string                 `msgpack:"password" json:"password"`

LDAPInfo holds information to authenticate a user using an LDAP Server.

func NewLDAPInfo

func NewLDAPInfo(metadata map[string]interface{}) (*LDAPInfo, error)

NewLDAPInfo returns a new LDAPInfo, or an error

func (*LDAPInfo) GetUserQueryString

func (i *LDAPInfo) GetUserQueryString() string

GetUserQueryString returns the query string based on the filter and username provided.

func (*LDAPInfo) ToMap

func (i *LDAPInfo) ToMap() map[string]interface{}

ToMap convert the LDAPInfo into a map[string]interface{}.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier