ldapx

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 6 Imported by: 0

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 `mapstructure:"url" json:"url,omitempty"`
	BaseDN               string `mapstructure:"base_dn" json:"base_dn,omitempty"`
	BindDN               string `mapstructure:"bind_dn" json:"bind_dn,omitempty"`
	BindPassword         string `mapstructure:"bind_password" json:"bind_password,omitempty"`
	UsernameAttribute    string `mapstructure:"username_attribute" json:"username_attribute,omitempty"`
	MailAttribute        string `mapstructure:"mail_attribute" json:"mail_attribute,omitempty"`
	DisplayNameAttribute string `mapstructure:"display_name_attribute" json:"display_name_attribute,omitempty"`
	TitleAttribute       string `mapstructure:"title_attribute" json:"title_attribute,omitempty"`
	UserFilter           string `mapstructure:"user_filter" json:"user_filter,omitempty"`
	GroupFilter          string `mapstructure:"group_filter" json:"group_filter"`
	GroupNameAttribute   string `mapstructure:"group_name_attribute" json:"group_name_attribute"`
}

type Connection

type Connection interface {
	Bind(username, password string) error
	Close()
	Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
	SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
}

type ConnectionImpl

type ConnectionImpl struct {
	// contains filtered or unexported fields
}

func NewLDAPConnectionImpl

func NewLDAPConnectionImpl(conn *ldap.Conn) *ConnectionImpl

func (*ConnectionImpl) Bind

func (lc *ConnectionImpl) Bind(username, password string) error

func (*ConnectionImpl) Close

func (lc *ConnectionImpl) Close()

func (*ConnectionImpl) Search

func (lc *ConnectionImpl) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)

func (*ConnectionImpl) SearchWithPaging

func (lc *ConnectionImpl) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)

type LdapProvider

type LdapProvider interface {
	CheckConnect() error
	VerifyUserCredentials(username string, password string) (*Profile, error)
	FindUserDetail(username string) (*Profile, error)
}

func NewLdap

func NewLdap(conf Config) LdapProvider

type Profile

type Profile struct {
	DN          string
	Email       string
	Username    string
	Title       string
	DisplayName string
	Groups      []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL