summaryrefslogtreecommitdiff
path: root/internal/authentication/file_user_provider.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2025-02-23 19:05:57 +1100
committerGitHub <noreply@github.com>2025-02-23 08:05:57 +0000
commit0af038e0ced689db90da480876a0bb26d78c6fb9 (patch)
tree5d97fe07636fcc5f7c6d87d6535bc5e1f0a9f2eb /internal/authentication/file_user_provider.go
parent197b45521f5e3799d0b9ef1ec0000d4f83abdee9 (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/file_user_provider.go')
-rw-r--r--internal/authentication/file_user_provider.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/authentication/file_user_provider.go b/internal/authentication/file_user_provider.go
index 02e0faa81..0dd84e085 100644
--- a/internal/authentication/file_user_provider.go
+++ b/internal/authentication/file_user_provider.go
@@ -25,7 +25,7 @@ type FileUserProvider struct {
config *schema.AuthenticationBackendFile
hash algorithm.Hash
database FileUserProviderDatabase
- mutex *sync.Mutex
+ mutex sync.Mutex
timeoutReload time.Time
}
@@ -33,7 +33,6 @@ type FileUserProvider struct {
func NewFileUserProvider(config *schema.AuthenticationBackendFile) (provider *FileUserProvider) {
return &FileUserProvider{
config: config,
- mutex: &sync.Mutex{},
timeoutReload: time.Now().Add(-1 * time.Second),
database: NewFileUserDatabase(config.Path, config.Search.Email, config.Search.CaseInsensitive, getExtra(config)),
}
@@ -77,6 +76,10 @@ func (p *FileUserProvider) Reload() (reloaded bool, err error) {
return true, nil
}
+func (p *FileUserProvider) Shutdown() (err error) {
+ return nil
+}
+
// CheckUserPassword checks if provided password matches for the given user.
func (p *FileUserProvider) CheckUserPassword(username string, password string) (match bool, err error) {
var details FileUserDatabaseUserDetails