Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
URL string `bson:"url" json:"url"`
SkipVerify bool `bson:"skip_verify" json:"skip_verify"`
BaseDN string `bson:"base_dn" json:"base_dn"`
AdditionalUsersDN string `bson:"additional_users_dn" json:"additional_users_dn"`
UsersFilter string `bson:"users_filter" json:"users_filter"`
AdditionalGroupsDN string `bson:"additional_groups_dn" json:"additional_groups_dn"`
GroupsFilter string `bson:"groups_filter" json:"groups_filter"`
GroupNameAttribute string `bson:"group_name_attribute" json:"group_name_attribute"`
UsernameAttribute string `bson:"username_attribute" json:"username_attribute"`
MailAttribute string `bson:"mail_attribute" json:"mail_attribute"`
DisplayNameAttribute string `bson:"display_name_attribute" json:"display_name_attribute"`
User string `bson:"user" json:"user"`
Password string `bson:"password" json:"password"`
}
Config represents the configuration related to LDAP server.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig represents the default LDAP config.
func (*Config) GetBaseDNFromUser ¶
GetBaseDNFromUser 从用户中获取BaseDN
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.