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/ldap_client_factory_config.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/ldap_client_factory_config.go')
| -rw-r--r-- | internal/authentication/ldap_client_factory_config.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/authentication/ldap_client_factory_config.go b/internal/authentication/ldap_client_factory_config.go new file mode 100644 index 000000000..c66222c79 --- /dev/null +++ b/internal/authentication/ldap_client_factory_config.go @@ -0,0 +1,27 @@ +package authentication + +type LDAPClientFactoryOptions struct { + Address string + Username string + Password string +} + +type LDAPClientFactoryOption func(*LDAPClientFactoryOptions) + +func WithAddress(address string) func(*LDAPClientFactoryOptions) { + return func(settings *LDAPClientFactoryOptions) { + settings.Address = address + } +} + +func WithUsername(username string) func(*LDAPClientFactoryOptions) { + return func(settings *LDAPClientFactoryOptions) { + settings.Username = username + } +} + +func WithPassword(password string) func(*LDAPClientFactoryOptions) { + return func(settings *LDAPClientFactoryOptions) { + settings.Password = password + } +} |
