providers/ldap: fix existing binder not being carried forward correctly
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
ca40d31dac
commit
8d3275817b
|
@ -10,6 +10,7 @@ import (
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"goauthentik.io/api/v3"
|
"goauthentik.io/api/v3"
|
||||||
|
"goauthentik.io/internal/outpost/ldap/bind"
|
||||||
directbind "goauthentik.io/internal/outpost/ldap/bind/direct"
|
directbind "goauthentik.io/internal/outpost/ldap/bind/direct"
|
||||||
memorybind "goauthentik.io/internal/outpost/ldap/bind/memory"
|
memorybind "goauthentik.io/internal/outpost/ldap/bind/memory"
|
||||||
"goauthentik.io/internal/outpost/ldap/constants"
|
"goauthentik.io/internal/outpost/ldap/constants"
|
||||||
|
@ -83,7 +84,11 @@ func (ls *LDAPServer) Refresh() error {
|
||||||
providers[idx].searcher = directsearch.NewDirectSearcher(providers[idx])
|
providers[idx].searcher = directsearch.NewDirectSearcher(providers[idx])
|
||||||
}
|
}
|
||||||
if *provider.BindMode.Ptr() == api.LDAPAPIACCESSMODE_CACHED {
|
if *provider.BindMode.Ptr() == api.LDAPAPIACCESSMODE_CACHED {
|
||||||
providers[idx].binder = memorybind.NewSessionBinder(providers[idx], providers[idx].binder)
|
var oldBinder bind.Binder
|
||||||
|
if existing != nil {
|
||||||
|
oldBinder = existing.binder
|
||||||
|
}
|
||||||
|
providers[idx].binder = memorybind.NewSessionBinder(providers[idx], oldBinder)
|
||||||
} else if *provider.BindMode.Ptr() == api.LDAPAPIACCESSMODE_DIRECT {
|
} else if *provider.BindMode.Ptr() == api.LDAPAPIACCESSMODE_DIRECT {
|
||||||
providers[idx].binder = directbind.NewDirectBinder(providers[idx])
|
providers[idx].binder = directbind.NewDirectBinder(providers[idx])
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue