Skip to content

Commit

Permalink
Fix naming of the user- and groupprovider services
Browse files Browse the repository at this point in the history
The services ared called "storage-userprovider" and "-groupprovider".
The 'ocis help' output was missleading. This also renames the structs
accordingly.
  • Loading branch information
rhafer committed Aug 12, 2021
1 parent 2927dc4 commit ddddebc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions ocis/pkg/runtime/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions storage/pkg/command/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions storage/pkg/command/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ddddebc

Please sign in to comment.