Documentation ¶
Index ¶
- func NewConfig(client ldap.Client) ldapclient.Config
- func NewDNMappingClient(parent ldap.Client, DNMapping map[string][]*ldap.Entry) ldap.Client
- func NewMatchingSearchErrorClient(parent ldap.Client, baseDN string, returnErr error) ldap.Client
- func NewPagingOnlyClient(parent ldap.Client, response *ldap.SearchResult) ldap.Client
- type DNMappingClient
- type Fake
- func (c *Fake) Add(addRequest *ldap.AddRequest) error
- func (c *Fake) Bind(username, password string) error
- func (c *Fake) Close()
- func (c *Fake) Compare(dn, attribute, value string) (bool, error)
- func (c *Fake) Del(delRequest *ldap.DelRequest) error
- func (c *Fake) ExternalBind() error
- func (c *Fake) IsClosing() bool
- func (c *Fake) Modify(modifyRequest *ldap.ModifyRequest) error
- func (c *Fake) ModifyDN(request *ldap.ModifyDNRequest) error
- func (c *Fake) ModifyWithResult(request *ldap.ModifyRequest) (*ldap.ModifyResult, error)
- func (c *Fake) PasswordModify(passwordModifyRequest *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)
- func (c *Fake) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
- func (c *Fake) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
- func (c *Fake) SetTimeout(d time.Duration)
- func (c *Fake) SimpleBind(simpleBindRequest *ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)
- func (c *Fake) Start()
- func (c *Fake) StartTLS(config *tls.Config) error
- func (c *Fake) UnauthenticatedBind(username string) error
- type MatchingSearchErrClient
- type PagingOnlyClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
func NewConfig(client ldap.Client) ldapclient.Config
NewConfig creates a new Config impl that regurgitates the given data
func NewDNMappingClient ¶
func NewDNMappingClient(parent ldap.Client, DNMapping map[string][]*ldap.Entry) ldap.Client
NewDNMappingClient returns a new DNMappingClient sitting on top of the parent client. This client returns the ldap entries mapped to with this DN in its' internal DN map, or defers to the parent if the DN is not mapped.
func NewMatchingSearchErrorClient ¶
NewMatchingSearchErrorClient returns a new MatchingSearchError client sitting on top of the parent client. This client returns the given error when a search base DN matches the given base DN, and defers to the parent otherwise.
func NewPagingOnlyClient ¶
func NewPagingOnlyClient(parent ldap.Client, response *ldap.SearchResult) ldap.Client
NewPagingOnlyClient returns a new PagingOnlyClient sitting on top of the parent client. This client returns the provided search response for any calls to SearchWithPaging, or defers to the parent if the call is not to the paged search function.
Types ¶
type DNMappingClient ¶
type DNMappingClient struct { ldap.Client DNMapping map[string][]*ldap.Entry }
DNMappingClient returns the LDAP entry mapped to by the base dn given, or if no mapping happens, defers to the parent
func (*DNMappingClient) Search ¶
func (c *DNMappingClient) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
type Fake ¶
type Fake struct { SimpleBindResponse *ldap.SimpleBindResult PasswordModifyResponse *ldap.PasswordModifyResult SearchResponse *ldap.SearchResult }
Fake is a mock client for an LDAP server The following methods define safe defaults for the return values. In order to adapt this test client for a specific test, anonymously include it and override the method being tested. In the over-riden method, if you are not covering all method calls with your override, defer to the parent for handling.
func (*Fake) ExternalBind ¶
func (*Fake) ModifyWithResult ¶
func (*Fake) PasswordModify ¶
func (c *Fake) PasswordModify(passwordModifyRequest *ldap.PasswordModifyRequest) (*ldap.PasswordModifyResult, error)
PasswordModify forwards a password modify request to the LDAP server
func (*Fake) SearchWithPaging ¶
func (c *Fake) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)
SearchWithPaging forwards a search request to the LDAP server and pages the response
func (*Fake) SetTimeout ¶
SetTimeout sets a timeout on the client
func (*Fake) SimpleBind ¶
func (c *Fake) SimpleBind(simpleBindRequest *ldap.SimpleBindRequest) (*ldap.SimpleBindResult, error)
SimpleBind binds to the LDAP server using the Simple Bind mechanism
func (*Fake) UnauthenticatedBind ¶
type MatchingSearchErrClient ¶
MatchingSearchErrClient returns the ReturnErr on every Search() where the search base DN matches the given DN or defers the search to the parent client
func (*MatchingSearchErrClient) Search ¶
func (c *MatchingSearchErrClient) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error)
type PagingOnlyClient ¶
type PagingOnlyClient struct { ldap.Client Response *ldap.SearchResult }
PagingOnlyClient responds with a canned search result for any calls to SearchWithPaging
func (*PagingOnlyClient) SearchWithPaging ¶
func (c *PagingOnlyClient) SearchWithPaging(searchRequest *ldap.SearchRequest, pagingSize uint32) (*ldap.SearchResult, error)