Skip to content

Commit

Permalink
Merge pull request #2656 from owncloud/glauth_v2
Browse files Browse the repository at this point in the history
use glauth v2
  • Loading branch information
wkloucek authored Oct 21, 2021
2 parents e548894 + 1ccc568 commit bd8a799
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion glauth/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 8 additions & 3 deletions glauth/pkg/server/glauth/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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{
Expand Down
13 changes: 9 additions & 4 deletions glauth/pkg/server/glauth/ocis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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...)
Expand Down
2 changes: 1 addition & 1 deletion glauth/pkg/server/glauth/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions glauth/pkg/server/glauth/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/cs3org/go-cs3apis v0.0.0-20211007101428-6d142794ec11
github.com/cs3org/reva v1.14.1-0.20211018074606-00d075577d05
github.com/disintegration/imaging v1.6.2
github.com/glauth/glauth v1.1.3-0.20210729125545-b9aecdfcac31
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
github.com/go-chi/chi/v5 v5.0.4
github.com/go-chi/render v1.0.1
github.com/go-logr/logr v0.4.0
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/arl/statsviz v0.4.0/go.mod h1:+5inUy/dxy11x/KSmicG3ZrEEy0Yr81AFm3dn4QC04M=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
Expand Down Expand Up @@ -379,8 +380,8 @@ github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
github.com/glauth/glauth v1.1.3-0.20210729125545-b9aecdfcac31 h1:QgF6e/eUnMxZ7RQ9WFdjT5irVT2awf5bCNj+2tFF7xk=
github.com/glauth/glauth v1.1.3-0.20210729125545-b9aecdfcac31/go.mod h1:kRuLdqjy/oyCzweA9kmjuyRvsglAqQAn6GmzXmKEvhY=
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733 h1:MK+W6dk4GV3g8ofk7+H/T9zBlNdgG55jJeb5+LsBKVo=
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733/go.mod h1:JvR27X1t1ODMyV5HoPlS7U4K3MIMqC93FkowSrOEZcw=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M=
Expand Down Expand Up @@ -705,7 +706,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
Expand Down

0 comments on commit bd8a799

Please sign in to comment.