Documentation ¶
Index ¶
- Constants
- func DetermineLDAPFilter(filter string) (string, error)
- func DetermineLDAPHost(hostport string, scheme Scheme) (string, error)
- func GetAttributeValue(entry *ldap.Entry, attributes []string) string
- func GetRawAttributeValue(entry *ldap.Entry, attributes []string) string
- func SplitLDAPQuery(query string) (attributes, scope, filter, extensions string, err error)
- type DerefAliases
- type LDAPURL
- type Scheme
- type Scope
Constants ¶
const ( DerefAliasesNever = ldap.NeverDerefAliases DerefAliasesSearching = ldap.DerefInSearching DerefAliasesFinding = ldap.DerefFindingBaseObj DerefAliasesAlways = ldap.DerefAlways )
Variables ¶
This section is empty.
Functions ¶
func DetermineLDAPFilter ¶
DetermineLDAPFilter determines the LDAP search filter. Filter is a valid LDAP filter Default to "(objectClass=*)" per RFC
func DetermineLDAPHost ¶
DetermineLDAPHost determines the host and port for the LDAP connection. The default host is localhost; the default port for scheme "ldap" is 389, for "ldaps" is 686
func GetAttributeValue ¶
GetAttributeValue finds the first attribute of those given that the LDAP entry has, and returns it. GetAttributeValue is able to query the DN as well as Attributes of the LDAP entry. If no value is found, the empty string is returned.
func GetRawAttributeValue ¶
func SplitLDAPQuery ¶
SplitLDAPQuery splits the query in the URL into the substituent parts. All sections are optional. Query syntax is attribute?scope?filter?extensions
Types ¶
type DerefAliases ¶
type DerefAliases int
DerefAliases is a valid LDAP alias dereference parameter
func DetermineDerefAliasesBehavior ¶
func DetermineDerefAliasesBehavior(derefAliasesString string) (DerefAliases, error)
type LDAPURL ¶
type LDAPURL struct { // Scheme is ldap or ldaps Scheme Scheme // Host is the host:port of the LDAP server Host string // The DN of the branch of the directory where all searches should start from BaseDN string // The attribute to search for QueryAttribute string // The scope of the search. Can be ldap.ScopeWholeSubtree, ldap.ScopeSingleLevel, or ldap.ScopeBaseObject Scope Scope // A valid LDAP search filter (e.g. "(objectClass=*)") Filter string }
LDAPURL holds a parsed RFC 2255 URL
type Scheme ¶
type Scheme string
Scheme is a valid ldap scheme
func DetermineLDAPScheme ¶
DetermineLDAPScheme determines the LDAP connection scheme. Scheme is one of "ldap" or "ldaps" Default to "ldap"
type Scope ¶
type Scope int
Scope is a valid LDAP search scope
func DetermineLDAPScope ¶
DetermineLDAPScope determines the LDAP search scope. Scope is one of "sub", "one", or "base" Default to "sub" to match mod_auth_ldap