update glauth to 20210729125545-b9aecdfcac31
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -3,6 +3,7 @@ package glauth
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/glauth/glauth/pkg/config"
|
||||
"github.com/glauth/glauth/pkg/handler"
|
||||
"github.com/nmcclain/ldap"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
@@ -100,6 +101,11 @@ func (h chainHandler) Delete(boundDN string, deleteDN string, conn net.Conn) (re
|
||||
return ldap.LDAPResultInsufficientAccessRights, nil
|
||||
}
|
||||
|
||||
// FindUser with the given username. Called by the ldap backend to authenticate the bind. Optional
|
||||
func (h chainHandler) FindUser(userName string) (bool, config.User, error) {
|
||||
return false, config.User{}, nil
|
||||
}
|
||||
|
||||
// NewChainHandler implements a chain backend with two backends
|
||||
func NewChainHandler(log log.Logger, bh handler.Handler, fh handler.Handler) handler.Handler {
|
||||
return chainHandler{
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/asim/go-micro/v3/metadata"
|
||||
"github.com/glauth/glauth/pkg/config"
|
||||
"github.com/glauth/glauth/pkg/handler"
|
||||
"github.com/glauth/glauth/pkg/stats"
|
||||
ber "github.com/nmcclain/asn1-ber"
|
||||
@@ -525,6 +526,11 @@ func (h ocisHandler) Delete(boundDN string, deleteDN string, conn net.Conn) (res
|
||||
return ldap.LDAPResultInsufficientAccessRights, nil
|
||||
}
|
||||
|
||||
// FindUser with the given username
|
||||
func (h ocisHandler) FindUser(userName string) (found bool, user config.User, err error) {
|
||||
return false, config.User{}, nil
|
||||
}
|
||||
|
||||
// NewOCISHandler implements a glauth backend with ocis-accounts as the datasource
|
||||
func NewOCISHandler(opts ...Option) handler.Handler {
|
||||
options := newOptions(opts...)
|
||||
|
||||
@@ -63,12 +63,12 @@ func Server(opts ...Option) (*LdapSvc, error) {
|
||||
case "ldap":
|
||||
bh = handler.NewLdapHandler(
|
||||
handler.Logger(s.log),
|
||||
handler.Config(s.backend),
|
||||
handler.Backend(s.backend.Backend),
|
||||
)
|
||||
case "owncloud":
|
||||
bh = handler.NewOwnCloudHandler(
|
||||
handler.Logger(s.log),
|
||||
handler.Config(s.backend),
|
||||
handler.Backend(s.backend.Backend),
|
||||
)
|
||||
case "accounts":
|
||||
bh = NewOCISHandler(
|
||||
@@ -101,12 +101,12 @@ func Server(opts ...Option) (*LdapSvc, error) {
|
||||
case "ldap":
|
||||
fh = handler.NewLdapHandler(
|
||||
handler.Logger(s.log),
|
||||
handler.Config(s.fallback),
|
||||
handler.Backend(s.fallback.Backend),
|
||||
)
|
||||
case "owncloud":
|
||||
fh = handler.NewOwnCloudHandler(
|
||||
handler.Logger(s.log),
|
||||
handler.Config(s.fallback),
|
||||
handler.Backend(s.fallback.Backend),
|
||||
)
|
||||
case "accounts":
|
||||
fh = NewOCISHandler(
|
||||
|
||||
Reference in New Issue
Block a user