Documentation ¶
Index ¶
- Constants
- Variables
- type AuthLDAP
- func (al *AuthLDAP) Authenticate(pctx *auth.AuthContext, creds *auth.Credentials) (*auth.AuthContext, bool)
- func (al *AuthLDAP) CredentialType() string
- func (al *AuthLDAP) Name() string
- func (al *AuthLDAP) Realm() string
- func (al *AuthLDAP) RenderTpl(name string, data interface{}) string
- func (al *AuthLDAP) Type() string
- type Config
- type EntryMap
Constants ¶
View Source
const ( ConnectModePlain int = iota ConnectModeLDAPS ConnectModeStartTLS UserBindDN = "UserBindDN" UserSearchFilter = "UserSearchFilter" GroupSearchFilter = "GroupSearchFilter" SubjectName = "SubjectName" Principal = "Principal" AuthLDAPUsertEntry = "authLDAPUserEntry" )
View Source
const ( Type = "authldap" DefaultName = "authldap" DefaultRealm = "default realm" )
Variables ¶
View Source
var Log *logrus.Entry = logging.GetLogger("authldap").WithField("pkg", "auth/backend/authldap")
Functions ¶
This section is empty.
Types ¶
type AuthLDAP ¶
type AuthLDAP struct {
// contains filtered or unexported fields
}
func (*AuthLDAP) Authenticate ¶
func (al *AuthLDAP) Authenticate(pctx *auth.AuthContext, creds *auth.Credentials) (*auth.AuthContext, bool)
func (*AuthLDAP) CredentialType ¶
type Config ¶
type Config struct { Name string Realm string ServerURL string `yaml:"serverURL"` Timeout int Insecure bool UserBindDN string `yaml:"userBindDN"` UserSearchBase string `yaml:"userSearchBase"` UserSearchFilter string `yaml:"userSearchFilter"` UserSearchGetAttributes []string `yaml:"userSearchGetAttributes"` AddPrincipalsFromGroups bool `yaml:"addPrincipalsFromGroups"` GroupSearchBase string `yaml:"groupSearchBase"` GroupSearchFilter string `yaml:"groupSearchFilter"` GroupSearchGetAttributes []string `yaml:"groupSearchGetAttributes"` SubjectNameTemplate string `yaml:"subjectNameTemplate"` PrincipalTemplate string `yaml:"principalTemplate"` UserNamePrincipal bool `yaml:"userNamePrincipal"` Principals []string CriticalOptions map[string]string `yaml:"criticalOptions"` Extensions map[string]string }
var Defaults *Config = &Config{ Name: DefaultName, Realm: DefaultRealm, ServerURL: "ldaps://127.0.0.1:636", Timeout: 5, Insecure: false, UserBindDN: "cn={{.UserName}},dc=example,dc=com", UserSearchBase: "dc=example,dc=com", UserSearchFilter: "(&(objectClass=user)(sAMAccountName={{.UserName}}))", UserSearchGetAttributes: []string{"cn", "displayName"}, AddPrincipalsFromGroups: true, GroupSearchBase: "dc=example,dc=com", GroupSearchFilter: "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.User.DN}}))", GroupSearchGetAttributes: []string{"cn"}, SubjectNameTemplate: "{{.User.displayName}}", PrincipalTemplate: "{{.Group.cn}}", UserNamePrincipal: true, Principals: []string{}, CriticalOptions: map[string]string{}, Extensions: map[string]string{}, }
Click to show internal directories.
Click to hide internal directories.