implement group queries

Signed-off-by: David Christofas <dchristofas@owncloud.com>
This commit is contained in:
David Christofas
2020-07-13 12:09:49 +02:00
parent d8c538f720
commit 70420fc8fc
8 changed files with 185 additions and 47 deletions
+8 -5
View File
@@ -165,13 +165,14 @@ func Server(cfg *config.Config) *cli.Command {
}
}
as, err := getAccountsService()
as, gs, err := getAccountsServices()
if err != nil {
return err
}
server, err := glauth.Server(
glauth.AccountsService(as),
glauth.GroupsService(gs),
glauth.Logger(logger),
glauth.Config(&cfg),
)
@@ -280,8 +281,8 @@ func Server(cfg *config.Config) *cli.Command {
}
}
// getAccountsService returns an ocis-accounts service
func getAccountsService() (accounts.AccountsService, error) {
// getAccountsServices returns an ocis-accounts service
func getAccountsServices() (accounts.AccountsService, accounts.GroupsService, error) {
service := micro.NewService()
// parse command line flags
@@ -291,7 +292,9 @@ func getAccountsService() (accounts.AccountsService, error) {
client.ContentType("application/json"),
)
if err != nil {
return nil, err
return nil, nil, err
}
return accounts.NewAccountsService("com.owncloud.api.accounts", service.Client()), nil
return accounts.NewAccountsService("com.owncloud.api.accounts", service.Client()),
accounts.NewGroupsService("com.owncloud.api.accounts", service.Client()),
nil
}