replace devldap with glauth

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2020-03-17 12:31:31 +01:00
parent 343ba5025a
commit 9702541f23
6 changed files with 68 additions and 332 deletions
-41
View File
@@ -1,41 +0,0 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-devldap/pkg/command"
svcconfig "github.com/owncloud/ocis-devldap/pkg/config"
"github.com/owncloud/ocis-devldap/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// DevLDAPCommand is the entrypoint for the devldap command.
func DevLDAPCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "devldap",
Usage: "Start devldap server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.DevLDAP),
Action: func(c *cli.Context) error {
scfg := configureDevLDAP(cfg)
return cli.HandleAction(
command.Server(scfg).Action,
c,
)
},
}
}
func configureDevLDAP(cfg *config.Config) *svcconfig.Config {
cfg.DevLDAP.Log.Level = cfg.Log.Level
cfg.DevLDAP.Log.Pretty = cfg.Log.Pretty
cfg.DevLDAP.Log.Color = cfg.Log.Color
cfg.DevLDAP.Tracing.Enabled = false
cfg.DevLDAP.LDAP.Addr = "localhost:9125"
return cfg.DevLDAP
}
func init() {
register.AddCommand(DevLDAPCommand)
}
+39
View File
@@ -0,0 +1,39 @@
package command
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-glauth/pkg/command"
svcconfig "github.com/owncloud/ocis-glauth/pkg/config"
"github.com/owncloud/ocis-glauth/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)
// GLAuthCommand is the entrypoint for the glauth command.
func GLAuthCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "glauth",
Usage: "Start glauth server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.GLAuth),
Action: func(c *cli.Context) error {
scfg := configureGLAuth(cfg)
return cli.HandleAction(
command.Server(scfg).Action,
c,
)
},
}
}
func configureGLAuth(cfg *config.Config) *svcconfig.Config {
cfg.GLAuth.Log.Level = cfg.Log.Level
cfg.GLAuth.Log.Pretty = cfg.Log.Pretty
cfg.GLAuth.Log.Color = cfg.Log.Color
return cfg.GLAuth
}
func init() {
register.AddCommand(GLAuthCommand)
}
+3 -3
View File
@@ -1,7 +1,7 @@
package config
import (
devldap "github.com/owncloud/ocis-devldap/pkg/config"
glauth "github.com/owncloud/ocis-glauth/pkg/config"
graphExplorer "github.com/owncloud/ocis-graph-explorer/pkg/config"
graph "github.com/owncloud/ocis-graph/pkg/config"
hello "github.com/owncloud/ocis-hello/pkg/config"
@@ -65,7 +65,7 @@ type Config struct {
Phoenix *phoenix.Config
WebDAV *webdav.Config
Reva *reva.Config
DevLDAP *devldap.Config
GLAuth *glauth.Config
Proxy *proxy.Config
}
@@ -80,7 +80,7 @@ func New() *Config {
Phoenix: phoenix.New(),
WebDAV: webdav.New(),
Reva: reva.New(),
DevLDAP: devldap.New(),
GLAuth: glauth.New(),
Proxy: proxy.New(),
}
}
+2 -2
View File
@@ -42,12 +42,12 @@ var (
"reva-auth-basic",
"reva-auth-bearer",
"reva-sharing",
"reva-storage-root",
//"reva-storage-root",
"reva-storage-home",
"reva-storage-home-data",
"reva-storage-oc",
"reva-storage-oc-data",
"devldap",
"glauth",
"konnectd",
"proxy",
}