Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { Bind(username, password string) error Close() Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error) Modify(modifyRequest *ldap.ModifyRequest) error }
Connection interface representing a connection to the ldap.
type ConnectionImpl ¶
type ConnectionImpl struct {
// contains filtered or unexported fields
}
ConnectionImpl the production implementation of an ldap connection.
func NewLDAPConnectionImpl ¶
func NewLDAPConnectionImpl(conn *ldap.Conn) *ConnectionImpl
NewLDAPConnectionImpl create a new ldap connection.
func (*ConnectionImpl) Bind ¶
func (lc *ConnectionImpl) Bind(username, password string) error
Bind binds ldap connection to a username/password.
func (*ConnectionImpl) Modify ¶
func (lc *ConnectionImpl) Modify(modifyRequest *ldap.ModifyRequest) error
Modify modifies an ldap object.
func (*ConnectionImpl) Search ¶
func (lc *ConnectionImpl) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
Search searches a ldap server.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider todo
func (*Provider) CheckUserPassword ¶
func (p *Provider) CheckUserPassword(inputUsername string, password string) (*UserProfile, error)
CheckUserPassword checks if provided password matches for the given user.
func (*Provider) GetDetails ¶
func (p *Provider) GetDetails(inputUsername string) (*UserProfile, error)
GetDetails retrieve the groups a user belongs to.
type UserProfile ¶
type UserProfile struct { DN string Emails []string Username string DisplayName string Groups []string }
UserProfile todo
type UserProvider ¶
type UserProvider interface { // 测试LDAP Server是否可用 // LDAP server地址 // LDAP 管理账号 (Login DN/Password) CheckConnect() error // 用户密码校验 CheckUserPassword(username string, password string) (bool, error) // ldap用户搜索 GetDetails(username string) (*UserProfile, error) // 更新用户密码 UpdatePassword(username string, newPassword string) error }
UserProvider LDAP provider
Click to show internal directories.
Click to hide internal directories.