Integrate ocis-devldap

Co-authored-by: Thomas Müller <thomas.mueller@tmit.eu>
This commit is contained in:
Ilja Neumann
2020-01-29 18:19:50 +01:00
committed by Ilja Neumann
parent 55d307e118
commit bbf086fed7
5 changed files with 101 additions and 19 deletions

41
pkg/command/devldap.go Normal file
View File

@@ -0,0 +1,41 @@
package command
import (
"github.com/micro/cli"
"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)
}

View File

@@ -1,8 +1,9 @@
package config
import (
graph "github.com/owncloud/ocis-graph/pkg/config"
devldap "github.com/owncloud/ocis-devldap/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"
konnectd "github.com/owncloud/ocis-konnectd/pkg/config"
ocs "github.com/owncloud/ocis-ocs/pkg/config"
@@ -63,6 +64,7 @@ type Config struct {
Phoenix *phoenix.Config
WebDAV *webdav.Config
Reva *reva.Config
DevLDAP *devldap.Config
}
// New initializes a new configuration with or without defaults.
@@ -76,5 +78,6 @@ func New() *Config {
Phoenix: phoenix.New(),
WebDAV: webdav.New(),
Reva: reva.New(),
DevLDAP: devldap.New(),
}
}

View File

@@ -55,6 +55,7 @@ var Extensions = []string{
"reva-storage-home-data",
"reva-storage-oc",
"reva-storage-oc-data",
"devldap",
}
// Runtime is a micro' runtime