testlib

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LDAPHostFail = "fail.com"

LDAPHostFail - when the LDAP host is set to this, Connect() will fail

View Source
var MockLDAPFields = []string{"uid", "gecos"}

MockLDAPFields is for field mapping tests in ValidateLogin

Functions

func EchoSetup

func EchoSetup(method, path, reader string) (c echo.Context, rec *httptest.ResponseRecorder)

EchoSetup gives an echo Context and resp recorder to work with in test functions

Types

type MockLDAP

type MockLDAP ldap.LDAPClient

MockLDAP lets us test LDAP code without an actual connection to a server

func (MockLDAP) Authenticate

func (l MockLDAP) Authenticate(username string, password string) (bool, map[string]string, error)

Authenticate mocks the method of the same name from LDAPClient

func (MockLDAP) Close

func (l MockLDAP) Close()

Close mocks the method of the same name from LDAPClient

func (MockLDAP) Connect

func (l MockLDAP) Connect() error

Connect mocks the method of the same name from LDAPClient

func (MockLDAP) GetGroupsOfUser

func (l MockLDAP) GetGroupsOfUser(username string) ([]string, error)

GetGroupsOfUser mocks the method of the same name from LDAPClient

Jump to

Keyboard shortcuts

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