use glauth v2

This commit is contained in:
Willy Kloucek
2021-10-21 07:35:10 +02:00
parent d6975c45e0
commit 1ccc568260
7 changed files with 25 additions and 15 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"strings"
glauthcfg "github.com/glauth/glauth/pkg/config"
glauthcfg "github.com/glauth/glauth/v2/pkg/config"
"github.com/oklog/run"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/glauth/pkg/config"
+8 -3
View File
@@ -3,8 +3,8 @@ package glauth
import (
"net"
"github.com/glauth/glauth/pkg/config"
"github.com/glauth/glauth/pkg/handler"
"github.com/glauth/glauth/v2/pkg/config"
"github.com/glauth/glauth/v2/pkg/handler"
"github.com/nmcclain/ldap"
"github.com/owncloud/ocis/ocis-pkg/log"
)
@@ -102,10 +102,15 @@ func (h chainHandler) Delete(boundDN string, deleteDN string, conn net.Conn) (re
}
// 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) {
func (h chainHandler) FindUser(userName string, searchByUPN bool) (bool, config.User, error) {
return false, config.User{}, nil
}
// FindGroup is not yet supported for the chain backend
func (h chainHandler) FindGroup(groupName string) (bool, config.Group, error) {
return false, config.Group{}, 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 -4
View File
@@ -8,9 +8,9 @@ import (
"strconv"
"strings"
"github.com/glauth/glauth/pkg/config"
"github.com/glauth/glauth/pkg/handler"
"github.com/glauth/glauth/pkg/stats"
"github.com/glauth/glauth/v2/pkg/config"
"github.com/glauth/glauth/v2/pkg/handler"
"github.com/glauth/glauth/v2/pkg/stats"
ber "github.com/nmcclain/asn1-ber"
"github.com/nmcclain/ldap"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
@@ -527,10 +527,15 @@ func (h ocisHandler) Delete(boundDN string, deleteDN string, conn net.Conn) (res
}
// FindUser with the given username
func (h ocisHandler) FindUser(userName string) (found bool, user config.User, err error) {
func (h ocisHandler) FindUser(userName string, searchByUPN bool) (found bool, user config.User, err error) {
return false, config.User{}, nil
}
// FindGroup with the given groupname
func (h ocisHandler) FindGroup(groupName string) (found bool, user config.Group, err error) {
return false, config.Group{}, nil
}
// NewOCISHandler implements a glauth backend with ocis-accounts as the datasource
func NewOCISHandler(opts ...Option) handler.Handler {
options := newOptions(opts...)
+1 -1
View File
@@ -3,7 +3,7 @@ package glauth
import (
"context"
"github.com/glauth/glauth/pkg/config"
"github.com/glauth/glauth/v2/pkg/config"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/ocis-pkg/log"
)
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"fmt"
"github.com/GeertJohan/yubigo"
"github.com/glauth/glauth/pkg/config"
"github.com/glauth/glauth/pkg/handler"
"github.com/glauth/glauth/v2/pkg/config"
"github.com/glauth/glauth/v2/pkg/handler"
"github.com/go-logr/logr"
"github.com/nmcclain/ldap"
"github.com/owncloud/ocis/glauth/pkg/mlogr"