update glauth to 20210729125545-b9aecdfcac31

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-07-29 22:22:23 +02:00
parent 1288314946
commit c7c944e07e
23 changed files with 130 additions and 98 deletions
+6
View File
@@ -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{
+6
View File
@@ -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...)
+4 -4
View File
@@ -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(