Documentation ¶
Index ¶
- Constants
- func DetermineLDAPFilter(filter string) (string, error)
- func DetermineLDAPHost(hostport string, scheme Scheme) (string, error)
- func SplitLDAPQuery(query string) (attributes, scope, filter, extensions string, err error)
- type DefaultLDAPUserIdentityFactory
- type DerefAliases
- type LDAPClientConfig
- type LDAPURL
- type LDAPUserAttributeDefiner
- func (d *LDAPUserAttributeDefiner) AllAttributes() util.StringSet
- func (d *LDAPUserAttributeDefiner) Email(user *ldap.Entry) string
- func (d *LDAPUserAttributeDefiner) ID(user *ldap.Entry) string
- func (d *LDAPUserAttributeDefiner) Name(user *ldap.Entry) string
- func (d *LDAPUserAttributeDefiner) PreferredUsername(user *ldap.Entry) string
- type LDAPUserIdentityFactory
- 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 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 DefaultLDAPUserIdentityFactory ¶
type DefaultLDAPUserIdentityFactory struct { ProviderName string Definer LDAPUserAttributeDefiner }
DefaultLDAPUserIdentityFactory creates Identities for LDAP user entries using an LDAPUserAttributeDefiner
func (*DefaultLDAPUserIdentityFactory) IdentityFor ¶
func (f *DefaultLDAPUserIdentityFactory) IdentityFor(user *ldap.Entry) (identity authapi.UserIdentityInfo, err error)
type DerefAliases ¶
type DerefAliases int
DerefAliases is a valid LDAP alias dereference parameter
func DetermineDerefAliasesBehavior ¶
func DetermineDerefAliasesBehavior(derefAliasesString string) (DerefAliases, error)
type LDAPClientConfig ¶
type LDAPClientConfig struct { // Scheme is ldap or ldaps Scheme Scheme // Host is the host:port of the LDAP server Host string // Insecure specifies if TLS is required for the connection. If true, either an ldap://... URL or // StartTLS must be supported by the server Insecure bool // TLSConfig holds the TLS options. Only used when Insecure=false TLSConfig *tls.Config }
LDAPClientConfig holds information for connecting to an LDAP server
func NewLDAPClientConfig ¶
func NewLDAPClientConfig(url LDAPURL, insecure bool, tlsConfig *tls.Config) LDAPClientConfig
NewLDAPClientConfig returns a new LDAPClientConfig
func (*LDAPClientConfig) Connect ¶
func (l *LDAPClientConfig) Connect() (*ldap.Conn, error)
Connect returns an established LDAP connection, or an error if the connection could not be made (or successfully upgraded to TLS). If no error is returned, the caller is responsible for closing the connection
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 LDAPUserAttributeDefiner ¶
type LDAPUserAttributeDefiner struct {
// contains filtered or unexported fields
}
LDAPUserAttributeDefiner defines the values corresponding to OpenShift Identities in LDAP entries by using a deterministic mapping of LDAP entry attributes to OpenShift Identity fields
func NewLDAPUserAttributeDefiner ¶
func NewLDAPUserAttributeDefiner(attributeMapping serverapi.LDAPAttributeMapping) LDAPUserAttributeDefiner
func (*LDAPUserAttributeDefiner) AllAttributes ¶
func (d *LDAPUserAttributeDefiner) AllAttributes() util.StringSet
AllAttributes gets all attributes listed in the LDAPUserAttributeDefiner
func (*LDAPUserAttributeDefiner) Email ¶
func (d *LDAPUserAttributeDefiner) Email(user *ldap.Entry) string
Email extracts the email value from an LDAP user entry
func (*LDAPUserAttributeDefiner) ID ¶
func (d *LDAPUserAttributeDefiner) ID(user *ldap.Entry) string
ID extracts the ID value from an LDAP user entry
func (*LDAPUserAttributeDefiner) Name ¶
func (d *LDAPUserAttributeDefiner) Name(user *ldap.Entry) string
Name extracts the name value from an LDAP user entry
func (*LDAPUserAttributeDefiner) PreferredUsername ¶
func (d *LDAPUserAttributeDefiner) PreferredUsername(user *ldap.Entry) string
PreferredUsername extracts the preferred username value from an LDAP user entry
type LDAPUserIdentityFactory ¶
type LDAPUserIdentityFactory interface {
IdentityFor(user *ldap.Entry) (identity authapi.UserIdentityInfo, err error)
}
LDAPUserIdentityFactory creates Identites for LDAP user entries.
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
const ( ScopeWholeSubtree Scope = ldap.ScopeWholeSubtree ScopeSingleLevel Scope = ldap.ScopeSingleLevel ScopeBaseObject Scope = ldap.ScopeBaseObject )
func DetermineLDAPScope ¶
DeterminmeLDAPScope determines the LDAP search scope. Scope is one of "sub", "one", or "base" Default to "sub" to match mod_auth_ldap