Documentation ¶
Index ¶
- Variables
- type IMultiLDAP
- type MultiLDAP
- func (multiples *MultiLDAP) Login(query *login.LoginUserQuery) (*login.ExternalUserInfo, error)
- func (multiples *MultiLDAP) Ping() ([]*ServerStatus, error)
- func (multiples *MultiLDAP) User(login string) (*login.ExternalUserInfo, ldap.ServerConfig, error)
- func (multiples *MultiLDAP) Users(logins []string) ([]*login.ExternalUserInfo, error)
- type MultiLDAPmock
- type ServerStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidCredentials is returned if username and password do not match ErrInvalidCredentials = ldap.ErrInvalidCredentials // ErrCouldNotFindUser is returned when username hasn't been found (not username+password) ErrCouldNotFindUser = ldap.ErrCouldNotFindUser // ErrNoLDAPServers is returned when there is no LDAP servers specified ErrNoLDAPServers = errors.New("no LDAP servers are configured") // ErrDidNotFindUser if request for user is unsuccessful ErrDidNotFindUser = errors.New("did not find a user") )
View Source
var GetConfig = ldap.GetConfig
GetConfig gets LDAP config
Functions ¶
This section is empty.
Types ¶
type IMultiLDAP ¶
type IMultiLDAP interface { Ping() ([]*ServerStatus, error) Login(query *login.LoginUserQuery) ( *login.ExternalUserInfo, error, ) Users(logins []string) ( []*login.ExternalUserInfo, error, ) User(login string) ( *login.ExternalUserInfo, ldap.ServerConfig, error, ) }
IMultiLDAP is interface for MultiLDAP
func New ¶
func New(configs []*ldap.ServerConfig, cfg *setting.Cfg) IMultiLDAP
New creates the new LDAP auth
type MultiLDAP ¶
type MultiLDAP struct {
// contains filtered or unexported fields
}
MultiLDAP is basic struct of LDAP authorization
func (*MultiLDAP) Login ¶
func (multiples *MultiLDAP) Login(query *login.LoginUserQuery) ( *login.ExternalUserInfo, error, )
Login tries to log in the user in multiples LDAP
func (*MultiLDAP) Ping ¶
func (multiples *MultiLDAP) Ping() ([]*ServerStatus, error)
Ping dials each of the LDAP servers and returns their status. If the server is unavailable, it also returns the error.
func (*MultiLDAP) User ¶
func (multiples *MultiLDAP) User(login string) ( *login.ExternalUserInfo, ldap.ServerConfig, error, )
User attempts to find an user by login/username by searching into all of the configured LDAP servers. Then, if the user is found it returns the user alongisde the server it was found.
type MultiLDAPmock ¶
type MultiLDAPmock struct { MultiLDAP ID int64 UserCalled bool LoginCalled bool UserInfo *user.User AuthModule string ExpectedErr error }
func (*MultiLDAPmock) Login ¶
func (m *MultiLDAPmock) Login(query *login.LoginUserQuery) ( *login.ExternalUserInfo, error, )
func (*MultiLDAPmock) User ¶
func (m *MultiLDAPmock) User(loginstr string) ( *login.ExternalUserInfo, ldap.ServerConfig, error, )
Click to show internal directories.
Click to hide internal directories.