diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2025-02-23 19:05:57 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-23 08:05:57 +0000 |
| commit | 0af038e0ced689db90da480876a0bb26d78c6fb9 (patch) | |
| tree | 5d97fe07636fcc5f7c6d87d6535bc5e1f0a9f2eb /internal/authentication/types.go | |
| parent | 197b45521f5e3799d0b9ef1ec0000d4f83abdee9 (diff) | |
feat(authentication): ldap connection pooling (#7217)
This implements optional LDAP connection pooling to optimize the speed of LDAP transactions.
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/authentication/types.go')
| -rw-r--r-- | internal/authentication/types.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/internal/authentication/types.go b/internal/authentication/types.go index d1853d5f3..145a83818 100644 --- a/internal/authentication/types.go +++ b/internal/authentication/types.go @@ -1,59 +1,13 @@ package authentication import ( - "crypto/tls" "fmt" "net/mail" "net/url" - "time" - "github.com/go-ldap/ldap/v3" "golang.org/x/text/language" ) -// LDAPClientFactory an interface of factory of LDAP clients. -type LDAPClientFactory interface { - DialURL(addr string, opts ...ldap.DialOpt) (client LDAPClient, err error) -} - -// LDAPClient is a cut down version of the ldap.Client interface with just the methods we use. -// -// Methods added to this interface that have a direct correlation with one from ldap.Client should have the same signature. -type LDAPClient interface { - Close() (err error) - IsClosing() bool - SetTimeout(timeout time.Duration) - - TLSConnectionState() (state tls.ConnectionState, ok bool) - StartTLS(config *tls.Config) (err error) - - Unbind() (err error) - Bind(username, password string) (err error) - SimpleBind(request *ldap.SimpleBindRequest) (result *ldap.SimpleBindResult, err error) - MD5Bind(host string, username string, password string) (err error) - DigestMD5Bind(request *ldap.DigestMD5BindRequest) (result *ldap.DigestMD5BindResult, err error) - UnauthenticatedBind(username string) (err error) - ExternalBind() (err error) - NTLMBind(domain string, username string, password string) (err error) - NTLMUnauthenticatedBind(domain string, username string) (err error) - NTLMBindWithHash(domain string, username string, hash string) (err error) - NTLMChallengeBind(request *ldap.NTLMBindRequest) (result *ldap.NTLMBindResult, err error) - - Modify(request *ldap.ModifyRequest) (err error) - ModifyWithResult(request *ldap.ModifyRequest) (result *ldap.ModifyResult, err error) - ModifyDN(m *ldap.ModifyDNRequest) (err error) - PasswordModify(request *ldap.PasswordModifyRequest) (result *ldap.PasswordModifyResult, err error) - - Add(request *ldap.AddRequest) (err error) - Del(request *ldap.DelRequest) (err error) - - Search(request *ldap.SearchRequest) (result *ldap.SearchResult, err error) - SearchWithPaging(request *ldap.SearchRequest, pagingSize uint32) (result *ldap.SearchResult, err error) - Compare(dn string, attribute string, value string) (same bool, err error) - - WhoAmI(controls []ldap.Control) (result *ldap.WhoAmIResult, err error) -} - // UserDetails represent the details retrieved for a given user. type UserDetails struct { Username string |
