Documentation ¶
Index ¶
- Variables
- type IMultiLDAP
- type MultiLDAP
- func (multiples *MultiLDAP) Login(query *models.LoginUserQuery) (*models.ExternalUserInfo, error)
- func (multiples *MultiLDAP) Ping() ([]*ServerStatus, error)
- func (multiples *MultiLDAP) User(login string) (*models.ExternalUserInfo, ldap.ServerConfig, error)
- func (multiples *MultiLDAP) Users(logins []string) ([]*models.ExternalUserInfo, error)
- type MultiLDAPmock
- type ServerStatus
Constants ¶
This section is empty.
Variables ¶
var ErrCouldNotFindUser = ldap.ErrCouldNotFindUser
ErrCouldNotFindUser is returned when username hasn't been found (not username+password)
var ErrDidNotFindUser = errors.New("did not find a user")
ErrDidNotFindUser if request for user is unsuccessful
var ErrInvalidCredentials = ldap.ErrInvalidCredentials
ErrInvalidCredentials is returned if username and password do not match
var ErrNoLDAPServers = errors.New("no LDAP servers are configured")
ErrNoLDAPServers is returned when there is no LDAP servers specified
var GetConfig = ldap.GetConfig
GetConfig gets LDAP config
var IsEnabled = ldap.IsEnabled
IsEnabled checks if LDAP is enabled
Functions ¶
This section is empty.
Types ¶
type IMultiLDAP ¶
type IMultiLDAP interface { Ping() ([]*ServerStatus, error) Login(query *models.LoginUserQuery) ( *models.ExternalUserInfo, error, ) Users(logins []string) ( []*models.ExternalUserInfo, error, ) User(login string) ( *models.ExternalUserInfo, ldap.ServerConfig, error, ) }
IMultiLDAP is interface for MultiLDAP
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 *models.LoginUserQuery) ( *models.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) ( *models.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 *models.User AuthModule string ExpectedErr error }
func (*MultiLDAPmock) Login ¶
func (m *MultiLDAPmock) Login(query *models.LoginUserQuery) ( *models.ExternalUserInfo, error, )
func (*MultiLDAPmock) User ¶
func (m *MultiLDAPmock) User(login string) ( *models.ExternalUserInfo, ldap.ServerConfig, error, )