remove auth basic command to improve config code

This commit is contained in:
David Christofas
2022-04-25 15:43:15 +02:00
parent 634d557279
commit 57e4e70888
14 changed files with 505 additions and 190 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
package command
import (
"github.com/owncloud/ocis/extensions/storage/pkg/command"
"github.com/owncloud/ocis/extensions/auth-basic/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis/pkg/register"
"github.com/urfave/cli/v2"
@@ -18,7 +18,7 @@ func StorageAuthBasicCommand(cfg *config.Config) *cli.Command {
return ParseStorageCommon(ctx, cfg)
},
Action: func(c *cli.Context) error {
origCmd := command.AuthBasic(cfg.Storage)
origCmd := command.AuthBasic(cfg.AuthBasic)
return handleOriginalAction(c, origCmd)
},
}
+3 -3
View File
@@ -20,6 +20,7 @@ import (
"github.com/olekukonko/tablewriter"
accounts "github.com/owncloud/ocis/extensions/accounts/pkg/command"
authbasic "github.com/owncloud/ocis/extensions/auth-basic/pkg/command"
glauth "github.com/owncloud/ocis/extensions/glauth/pkg/command"
graphExplorer "github.com/owncloud/ocis/extensions/graph-explorer/pkg/command"
graph "github.com/owncloud/ocis/extensions/graph/pkg/command"
@@ -35,7 +36,6 @@ import (
thumbnails "github.com/owncloud/ocis/extensions/thumbnails/pkg/command"
web "github.com/owncloud/ocis/extensions/web/pkg/command"
webdav "github.com/owncloud/ocis/extensions/webdav/pkg/command"
"github.com/owncloud/ocis/ocis-pkg/config"
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/rs/zerolog"
@@ -112,7 +112,7 @@ func NewService(options ...Option) (*Service, error) {
s.ServicesRegistry["storage-gateway"] = storage.NewGateway
s.ServicesRegistry["storage-userprovider"] = storage.NewUserProvider
s.ServicesRegistry["storage-groupprovider"] = storage.NewGroupProvider
s.ServicesRegistry["storage-authbasic"] = storage.NewAuthBasic
s.ServicesRegistry["storage-authbasic"] = authbasic.NewAuthBasic
s.ServicesRegistry["storage-authbearer"] = storage.NewAuthBearer
s.ServicesRegistry["storage-authmachine"] = storage.NewAuthMachine
s.ServicesRegistry["storage-users"] = storage.NewStorageUsers
@@ -241,7 +241,7 @@ func scheduleServiceTokens(s *Service, funcSet serviceFuncMap) {
// generateRunSet interprets the cfg.Runtime.Extensions config option to cherry-pick which services to start using
// the runtime.
func (s *Service) generateRunSet(cfg *config.Config) {
func (s *Service) generateRunSet(cfg *ociscfg.Config) {
if cfg.Runtime.Extensions != "" {
e := strings.Split(strings.ReplaceAll(cfg.Runtime.Extensions, " ", ""), ",")
for i := range e {