From ddddebc10aac853aa9648eb9a71cb1e74f4c4fdd Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Thu, 12 Aug 2021 15:04:08 +0200 Subject: [PATCH] Fix naming of the user- and groupprovider services The services ared called "storage-userprovider" and "-groupprovider". The 'ocis help' output was missleading. This also renames the structs accordingly. --- go.mod | 1 + ocis/pkg/runtime/service/service.go | 4 ++-- storage/pkg/command/groups.go | 12 ++++++------ storage/pkg/command/users.go | 12 ++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 134f67d7c30..51c975d97f0 100644 --- a/go.mod +++ b/go.mod @@ -83,6 +83,7 @@ require ( replace ( github.com/crewjam/saml => github.com/crewjam/saml v0.4.5 + github.com/cs3org/reva => ../reva go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd ) diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 3e9767e3a31..a42a20c12c2 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -103,8 +103,8 @@ func NewService(options ...Option) (*Service, error) { s.ServicesRegistry["webdav"] = webdav.NewSutureService s.ServicesRegistry["storage-frontend"] = storage.NewFrontend s.ServicesRegistry["storage-gateway"] = storage.NewGateway - s.ServicesRegistry["storage-users-provider"] = storage.NewUsersProviderService - s.ServicesRegistry["storage-groupsprovider"] = storage.NewGroupsProvider + s.ServicesRegistry["storage-userprovider"] = storage.NewUserProvider + s.ServicesRegistry["storage-groupprovider"] = storage.NewGroupProvider s.ServicesRegistry["storage-authbasic"] = storage.NewAuthBasic s.ServicesRegistry["storage-authbearer"] = storage.NewAuthBearer s.ServicesRegistry["storage-home"] = storage.NewStorageHome diff --git a/storage/pkg/command/groups.go b/storage/pkg/command/groups.go index 8113aef6177..34f0da6406c 100644 --- a/storage/pkg/command/groups.go +++ b/storage/pkg/command/groups.go @@ -156,22 +156,22 @@ func groupsConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]inter } } -// GroupsProvider allows for the storage-groupsprovider command to be embedded and supervised by a suture supervisor tree. -type GroupsProvider struct { +// GroupProvider allows for the storage-groupprovider command to be embedded and supervised by a suture supervisor tree. +type GroupProvider struct { cfg *config.Config } -// NewGroupsProvider creates a new storage.GroupsProvider -func NewGroupsProvider(cfg *ociscfg.Config) suture.Service { +// NewGroupProvider creates a new storage.GroupProvider +func NewGroupProvider(cfg *ociscfg.Config) suture.Service { if cfg.Mode == 0 { cfg.Storage.Reva.Groups.Supervised = true } - return GroupsProvider{ + return GroupProvider{ cfg: cfg.Storage, } } -func (s GroupsProvider) Serve(ctx context.Context) error { +func (s GroupProvider) Serve(ctx context.Context) error { s.cfg.Reva.Groups.Context = ctx f := &flag.FlagSet{} for k := range Groups(s.cfg).Flags { diff --git a/storage/pkg/command/users.go b/storage/pkg/command/users.go index f087c9a56ad..f93171e1eb7 100644 --- a/storage/pkg/command/users.go +++ b/storage/pkg/command/users.go @@ -159,22 +159,22 @@ func usersConfigFromStruct(c *cli.Context, cfg *config.Config) map[string]interf return rcfg } -// UsersProviderService allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree. -type UsersProviderService struct { +// UserProvider allows for the storage-userprovider command to be embedded and supervised by a suture supervisor tree. +type UserProvider struct { cfg *config.Config } -// NewUsersProviderService creates a new storage.UsersProviderService -func NewUsersProviderService(cfg *ociscfg.Config) suture.Service { +// NewUserProvider creates a new storage.UserProvider +func NewUserProvider(cfg *ociscfg.Config) suture.Service { if cfg.Mode == 0 { cfg.Storage.Reva.Users.Supervised = true } - return UsersProviderService{ + return UserProvider{ cfg: cfg.Storage, } } -func (s UsersProviderService) Serve(ctx context.Context) error { +func (s UserProvider) Serve(ctx context.Context) error { s.cfg.Reva.Users.Context = ctx f := &flag.FlagSet{} for k := range Users(s.cfg).Flags {