service

package
v0.0.0-testrgm6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnableToCreateLDAPClient = errors.New("unable to create LDAP client")
	ErrLDAPNotEnabled           = errors.New("LDAP not enabled")
)

Functions

This section is empty.

Types

type LDAP

type LDAP interface {
	ReloadConfig() error
	Config() *ldap.Config
	Client() multildap.IMultiLDAP

	// Login authenticates the user against the LDAP server.
	Login(query *login.LoginUserQuery) (*login.ExternalUserInfo, error)
	// User searches for a user in the LDAP server.
	User(username string) (*login.ExternalUserInfo, error)
}

LDAP is the interface for the LDAP service.

type LDAPFakeService

type LDAPFakeService struct {
	ExpectedConfig *ldap.Config
	ExpectedClient multildap.IMultiLDAP
	ExpectedError  error
	ExpectedUser   *login.ExternalUserInfo
	UserCalled     bool
}

func NewLDAPFakeService

func NewLDAPFakeService() *LDAPFakeService

func (*LDAPFakeService) Client

func (s *LDAPFakeService) Client() multildap.IMultiLDAP

func (*LDAPFakeService) Config

func (s *LDAPFakeService) Config() *ldap.Config

func (*LDAPFakeService) Login

func (*LDAPFakeService) ReloadConfig

func (s *LDAPFakeService) ReloadConfig() error

func (*LDAPFakeService) User

func (s *LDAPFakeService) User(username string) (*login.ExternalUserInfo, error)

type LDAPImpl

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

func ProvideService

func ProvideService(cfg *setting.Cfg) *LDAPImpl

func (*LDAPImpl) Client

func (s *LDAPImpl) Client() multildap.IMultiLDAP

func (*LDAPImpl) Config

func (s *LDAPImpl) Config() *ldap.Config

func (*LDAPImpl) Login

func (*LDAPImpl) ReloadConfig

func (s *LDAPImpl) ReloadConfig() error

func (*LDAPImpl) User

func (s *LDAPImpl) User(username string) (*login.ExternalUserInfo, error)

Jump to

Keyboard shortcuts

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